{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eGugle is one of the most powerful information technology companies. Now it has another new office whose layout looks like an \u003cem\u003eN × M \u003c/em\u003egrids. Some cells in the grids\u0026nbsp;\u0026nbsp;are occupied by chairs; some cells are occupied by computers; while others are empty. \r\n\u003c/p\u003e\u003cp\u003eEngineers in Gugle are all hard-working. Every one asks for two nearby computers (sharing a common edge with his chair) so he can operates both simultaneously at work. Futher more, no one can operate two computers in opposite directions at the same time, so the both computers must forms a right angle.\r\n\u003c/p\u003e\u003cp\u003eFor eaxample, when an engineer sits at \u003cem\u003e(x, y)\u003c/em\u003e, he can\u0027t operate computers located at \u003cem\u003e(x+1, y) \u003c/em\u003eand \u003cem\u003e(x-1, y) \u003c/em\u003esimultaneously. Instead he may operate computers at \u003cem\u003e(x-1, y) \u003c/em\u003eand \u003cem\u003e(x, y-1)\u003c/em\u003e.\r\n\u003c/p\u003e\u003cp\u003eGugle wants to know many engineers this office can hold without moving the computers and chairs.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"First line: \u003cem\u003eN (N ≤ 500), M (M ≤ 500)\u003c/em\u003e\u003cbr\u003eNext \u003cem\u003eN\u003c/em\u003e lines: \u003cem\u003eM\u003c/em\u003e integers. 0 for empty cells, 1 for chairs and 2 for computers."}},{"title":"Output","value":{"format":"HTML","content":"The maximum engineers can be hold."}},{"title":"Sample","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\u003e3 4\r\n2 2 1 2\r\n0 1 2 2\r\n2 2 2 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}