The Painted Cells#59

The Painted Cells

1 second
64 megabytes
Medium

On a sheet of squared paper, a polyline consisting of vertices is drawn, and each vertex is located at an intersection of the grid lines. Each cell that contains at least one point of the polyline is considered painted.

Determine the number of painted cells. The coordinate system's origin is at a grid intersection, the axes are parallel to the grid lines, and one unit corresponds to the side length of a cell.

Input

The first line contains — the number of vertices of the polyline.

Each of the next lines contains two integers and (-100 \le x, y \le 100) — the coordinates of each vertex.

Output

Print the number of painted cells.

Examples

Example 11

Loading
Loading