#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(arg),key)-begin(arg)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
using namespace std;
 
template<class T>void reg(vector<T> &ary,const T &elem){ary.emplace_back(elem);}
template<class T>bool chmin(T &a, const T &b) {return (b<a)?(a=b,1):0;}
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
 
using R=long double; // __float128
const R EPS = 1E-11; // [-1000:1000]->EPS=1e-8 [-10000:10000]->EPS=1e-7
const R INF = 1E40;
constexpr R PI = acos(R(-1));
inline int sgn(const R& r){ return (r > EPS) - (r < -EPS);}
inline int sgn(const R& a, const R &b){ return sgn(a-b); }
inline R sq(R x){return sqrt(max<R>(x,0.0));}
 
using P=complex<R>;
using VP=vector<P>;
using L=struct{P s,t;};
using VL=vector<L>;
using C=struct{P c;R r;};
using VC=vector<C>;
 
constexpr P O = P(0,0);
istream& operator >> (istream& is,P& p){ R x,y;is >> x >> y; p=P(x,y); return is;}
ostream& operator << (ostream& os,P& p){ os << real(p) << " " << imag(p); return os;}
 
namespace std{
    bool operator <  (const P& a,const P& b){ return sgn(real(a-b))?real(a-b)<0:sgn(imag(a-b))<0;}
    bool operator == (const P& a,const P& b){ return sgn(real(a-b))==0 && sgn(imag(a-b))==0;}
}
 
inline bool cmp_x(const P& p,const P& q){return sgn(real(p-q))?real(p)<real(q):sgn(imag(p-q));}
inline bool cmp_y(const P& a, const P& b){return sgn(imag(a-b)) ? imag(a-b)<0 : sgn(real(a-b))<0;}
inline bool cmp_a(const P& a, const P& b){return sgn(arg(a)-arg(b)) ? arg(a)-arg(b)<0 : sgn(norm(a)-norm(b))<0;}
bool operator <  (const L& a,const L& b){ return a.s==b.s?a.t<b.t:a.s<b.s;}
bool operator == (const L& a,const L& b){ return a.s==b.s&&a.t==b.t;}
 
//?????? dot ?????? det
inline R dot(P o,P a,P b){a-=o,b-=o; return real(conj(a)*b);}
inline R det(P o,P a,P b){a-=o,b-=o; return imag(conj(a)*b);}
inline P vec(L l){return l.t-l.s;}
 
// ???????????? ???????????????????????´??????1,????????´??????0
bool ils(L l,L s,int end=0){ return sgn(det(l.s,l.t,s.s)*det(l.s,l.t,s.t))<=-end;}
// ?????? verify AOJ CGL_2_C
P cross(L a,L b){
    R s1=det(a.s,b.s,b.t);
    R s2=s1+det(a.t,b.t,b.s);
    return a.s+s1/s2*(a.t-a.s);
}

int main(void){
    for(int n; cin >> n, n;){
        VP pol(n);
        for(auto& e : pol) cin >> e;

        int res = 0;
        const int M = 2000;
        rep(y, -M, M){
            L l1 = {{0, (R)y}, {1, (R)y}};
            L l2 = {{0, (R)y + 1}, {1, (R)y + 1}};

            vector<R> xs1, xs2;
            rep(i, n){
                int j = (i + 1) % n;
                L seg = {pol[i], pol[j]};
                if(ils(l1, seg) and ils(l2, seg)){
                    xs1.emplace_back(real(cross(l1, seg)));
                    xs2.emplace_back(real(cross(l2, seg)));
                }
            }
            sort(_all(xs1)); sort(_all(xs2));

            int len = xs1.size();
            vector<R> xs(len);
            int lb = -M;
            rep(i, len){
                if(i % 2 == 0){
                    xs[i] = floor(min(xs1[i], xs2[i]));
                    chmax(xs[i], (R)lb);
                }
                else {
                    xs[i] = ceil(max(xs1[i], xs2[i]));
                    chmax(lb, (int)xs[i]);
                }
            }

            /*
            if(len != 0){
                cerr << "y = " << y << " - " << y + 1 << endl;
                for(auto& e : xs){
                    cerr << e << " ";
                }
                cerr << endl;
            }
            */

            rep(i, len){
                if(i % 2 == 1) continue;
                res += xs[i + 1] - xs[i];
            }
        }

        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 3300