Fence

John Zynoulus has a garden full of blue-black flowers. They are arranged in a square grid pattern.

However, Measharan scientists warn that there is a risk of a red rabbit invasion. The rabbits like to eat blue-black flowers, so John needs to put a fence to protect some of our flowers. For reasons of simplicity and aesthetics, we have decided that our fence will have a polygonal shape, and each of its vertices will be placed where a flower originally was. For example, the fence below protects 7 blue-black flowers from red rabbits.

image

John has designed the shape of the fence, but has some problems with calculating the number of blue-black flowers inside it. Can you help him?

Input

The first line contains the number of vertices NN, 3N1000003 \leq N \leq 100000.

ii-th of the following next NN lines contains coordinates xix_i, yiy_i of the ii-th vertex of the polygon, where |xi|,|yi|10000|x_i|, |y_i| \leq 10000. Each pair (xi,yi)(x_i, y_i) is distinct, and edges of our polygon don’t intersect (except in vertices).

Output

Output the number of grid points inside the polygon.

Problem information

Author: Eryk Kopczynski

Generation: 2026-01-25T21:41:14.018Z

© Jutge.org, 2006–2026.
https://jutge.org