import java.awt.geom.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;

public class aa {
	
	public static GeneralPath path;
	public static int count;

	public static void testRect(int x,int y,int w,int h) {
		if (!path.intersects(x+1,y+1,w-1,h-1)) return;
		if (path.contains(x+1,y+1,w-1,h-1)) {
			count+= (w/100) * (h/100);
			return;
		}
		int w2 = w/2;
		if (w2*2!=w) w2-= 50;
		int h2 = h/2;
		if (h2*2!=h) h2-= 50;
		if (w2*2>100 && h2*2>100) {
			testRect(x,y,w2,h2);
			testRect(x+w2,y,w-w2,h2);
			testRect(x,y+h2,w2,h-h2);
			testRect(x+w2,y+h2,w-w2,h-h2);
		}	
		
	}

	public static void main(String[] args) throws Exception {
		String l;
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
		while ((l=r.readLine())!=null) {
			int cnt = Integer.parseInt(l);
			if (cnt==0) break;
			path = new GeneralPath();
			int minx = Integer.MAX_VALUE,miny=Integer.MAX_VALUE,maxx=Integer.MIN_VALUE,maxy=Integer.MIN_VALUE;
			for (int i=0;i<cnt;i++) {
				String c = r.readLine();
				int sp = c.indexOf(' ');
				int x = Integer.parseInt(c.substring(0,sp))*100;
				int y = Integer.parseInt(c.substring(sp+1))*100;
				minx = Math.min(minx,x);
				maxx = Math.max(maxx,x);
				miny = Math.min(miny,y);
				maxy = Math.max(maxy,y);
				if (i==0) path.moveTo(x,y);
				else path.lineTo(x,y);
			}
			path.closePath();
			count = 0;
			testRect(minx,miny,maxx-minx,maxy-miny);			
			//System.out.println(""+minx+","+miny+","+maxx+","+maxy);
			System.out.println(count);
		}
	}
}