#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;
typedef complex<double> C;

int n;
C t[102];
bool flg[5000];

namespace std
{
    bool operator < (const C a, const C b) {
        return a.real() != b.real() ? a.real() < b.real() : a.imag() < b.imag();
    }
}

struct L : public vector<C>
{
    L(){}
    L(const C a, const C b) {
        push_back(a); push_back(b);
    }
};

//??????
double cross(const C a, const C b)
{
    return imag(conj(a)*b);
}

//??´???????????????????????????
C crosspointLL(const L& l, const L& m)
{
    double A = cross(l[1] - l[0], m[1] - m[0]);
    double B = cross(l[1] - l[0], l[1] - m[0]);
    //????????´????????¨???
    if(abs(A) < EPS && abs(B) < EPS){
        return m[0];
    }
    return m[0] + B / A * (m[1] - m[0]);
}

vector<double> get(double y){
    vector<double> v;
    L l = L(C(-2001,y),C(2001,y));
    rep(i,n){
        L lll = L(t[i],t[(i+1)%n]);
        if(t[i].imag() < y && y < t[(i+1)%n].imag() || t[(i+1)%n].imag() < y && y < t[i].imag()){
            C p = crosspointLL(l,lll);
            v.push_back(p.real());
        }
    }
    sort(v.begin(),v.end());
    return v;
}

int main(){
    while(1){
        scanf("%d",&n);
        if(n == 0){
            break;
        }
        int hy = -2001, ly = 2001;
        rep(i,n){
            int a,b;
            scanf("%d%d",&a,&b);
            t[i] = C(a+2000,b+2000);
            hy = max(hy,(int)t[i].imag());
            ly = min(ly,(int)t[i].imag());
        }
        int res = 0;
        srep(i,ly,hy){
            memset(flg,0,sizeof(flg));
            vector<double> v1 = get(i+EPS);
            vector<double> v2 = get(i+1-EPS);
            for(int i=0;i<v1.size();i+=2){
                int from = floor(min(v1[i],v2[i]));
                int to = ceil(max(v1[i+1],v2[i+1]));
                for(int j=from;j<to;j++){
                    if(!flg[j]){
                        res++;
                        flg[j] = true;
                    }
                }
            }
        }
        printf("%d\n",res);
    }
}