{"problem":{"name":"Flipper","description":{"content":"There is a square grid of dimensions $10^9 \\times 10^9$. The cells are numbered $(1, 1)$ through $(10^9, 10^9)$. Cell $(i, j)$ is in the $i$\\-th row from the top, and the $j$\\-th column from the left.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc051_c"},"statements":[{"statement_type":"Markdown","content":"There is a square grid of dimensions $10^9 \\times 10^9$. The cells are numbered $(1, 1)$ through $(10^9, 10^9)$. Cell $(i, j)$ is in the $i$\\-th row from the top, and the $j$\\-th column from the left. Initially, $N$ cells $(x_1, y_1), \\ldots, (x_N, y_N)$ are black, and all other cells are white.\nSnuke can perform the following operation an arbitrary number of times:\n\n*   Choose an integer $x (1 \\leq x \\leq 10^9 - 1)$ and an integer $y (1 \\leq y \\leq 10^9 - 2)$, and flip (black to white, white to black) the colors of the following six cells: $(x, y), (x, y+1), (x, y+2), (x+1, y), (x+1, y+1), (x+1, y+2)$\n\nCompute the minimum possible number of black cells after the operations.\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq x_i, y_i \\leq 10^9$\n*   $(x_i, y_i)$ are pairwise distinct.\n*   All values in the input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$x_1 \\ y_1$\n$:$\n$x_N \\ y_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc051_c","tags":[],"sample_group":[["9\n1 2\n1 3\n2 1\n2 3\n2 4\n3 2\n3 3\n3 4\n4 2","3\n\nIn the diagram below, the $j$\\-th letter of the $i$\\-th string from the top represents the cell $(i, j)$. `#` is black, `.` is white.\n\n.##.\n#.##\n.###\n.#..\n\n->\n\n#...\n.#.#\n.###\n.#..\n\n->\n\n#...\n..#.\n....\n.#.."]],"created_at":"2026-03-03 11:01:14"}}