eolymp
bolt
Try our new interface for solving problems
Problems

The Cells are Painted out

The Cells are Painted out

\includegraphics{https://static.e-olymp.com/content/69/690df202ad892005261bde6b2659adf5695ab488.jpg} On the sheet of paper in a cell is the broken line with N summits. They lie on the crossings of the lines of the net. All of cells which was crossed by broken line painted out (a cell is considered crossed if it has even one general point with broken line). You have to calculate the quantity of the painted out cells if beginning of the system of coordinates lies on the crossing of the lines of the net and parallel to lines of the net, and a single segment equals the side of cell. \InputFile There is a natural number \textbf{N} -- the quantity of the summits of the broken line in the first line. In next \textbf{N} lines are two integers, absence is between them. Each of them is co-ordinates each of summits of the broken line. All of numbers do not exceed \textbf{100} by the module. \OutputFile You have to write the quantity of the crossed cells.
Time limit 1 second
Memory limit 64 MiB
Input example #11
3
2 3
-2 0
1 -2
Output example #11
18