{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eThe Theater Square can be represented as a rectangle having height $$$n$$$ and length $$$m$$$, divided into square $$$1 \\times 1$$$ cells. Let\u0027s denote the cell located at the intersection of $$$i$$$-th row and $$$j$$$-th column as $$$(i, j)$$$. The rows are numbered from top to bottom, the columns — from left to right.\u003c/p\u003e\u003cp\u003eThere is a rectangular fountain inside the Teather Square. The cell in its left upper corner is $$$(x_1, y_1)$$$, the cell in its right lower corner is $$$(x_2, y_2)$$$. \u003c/p\u003e\u003cp\u003eThe Theater Square soon will be paved with tiles having height $$$1$$$ and length $$$2$$$. Every cell \u003cspan class\u003d\"tex-font-style-bf\"\u003e(except cells inside the fountain)\u003c/span\u003e should be paved, and no cell should be covered by more than one tile. All tiles will be laid out horizontally, so the cells covered by each tile are in the same row. To pave the whole Theater Square it might be necessary to break some tiles. After breaking a tile, two new tiles of size $$$1 \\times 1$$$ are formed (which cannot be broken further). You may consider that the mayor, who ordered the paving of the Theater Square, has infinite number of tiles $$$1 \\times 2$$$. \u003c/p\u003e\u003cp\u003eSince broken tiles are not beautiful, among all possible ways to pave the Theater Square the mayor wants to choose a way such that \u003cspan class\u003d\"tex-font-style-bf\"\u003ethe number of tiles to be broken into two lesser tiles\u003c/span\u003e is minimum possible. Pay attention that \u003cspan class\u003d\"tex-font-style-bf\"\u003etiles should be laid horizontally\u003c/span\u003e, no tile can cover cells in different rows. \u003c/p\u003e\u003cp\u003eHelp the mayor! Tell him the minimum possible number of tiles to be broken. \u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains two integers $$$n$$$ and $$$m$$$ $$$(1 \\le n, m \\le 2 \\cdot 10^5)$$$ — the height and the length of the Theater Square, respectively.\u003c/p\u003e\u003cp\u003eThe second line contains four numbers $$$x_1, y_1, x_2, y_2 ~ (1 \\le x_1 \\le x_2 \\le n, 1 \\le y_1 \\le y_2 \\le m)$$$ — the coordinates of left upper corner and right lower corner of the fountain.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003ePrint one number — minimum possible number of tiles mayor has to break in order to pave the whole Theater Square. \u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 5\n1 2 3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e6 1\n3 1 4 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e1 12\n1 3 1 8\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eOne of the optimal ways to pave the Theater Square in the first example: \u003c/p\u003e\u003ccenter\u003e \u003cimg class\u003d\"tex-graphics\" src\u003d\"CDN_BASE_URL/88da652a2be60dd2362b29436a0818d1?v\u003d1717240973\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e \u003c/center\u003e $$$5$$$ tiles are to be broken."}}]}