{
TASK:green
LANG:PASCAL
}
type coords=Record
        x,y:longint;
     End;
var mount:Array[1..100] of coords;
    i,j,k:Longint;
    minnr,minm,p1,p2,n,c,x1,y1,x2,y2,x3,y3,cx,cy:Longint;
    s:String;
    code:Integer;
    num:QWord;
    lice,da,db,dc,min,nowmin,p:Extended;
Begin
  min:=maxlongint;
  nowmin:=maxlongint;
  minm:=maxlongint;
  num:=0;
 Repeat
   Read(c);
  if c=0 then
  Begin
    WriteLn(minnr);
    Exit;
  End;
   num:=num+1;
  For i:=1 to c do
  Begin
    read(mount[i].x);
    read(mount[i].y);
  End;
   lice:=0;
  For k:=3 to c do
  Begin
    x1:=mount[k-2].x;
    y1:=mount[k-2].y;
    x2:=mount[k-1].x;
    y2:=mount[k-1].y;
    x3:=mount[k].x;
    y3:=mount[k].y;
    da:=sqrt(sqr(x1-x2)+sqr(y1-y2));
    db:=sqrt(sqr(x2-x3)+sqr(y2-y3));
    dc:=sqrt(sqr(x3-x1)+sqr(y3-y1));
    p:=(da+db+dc)/2;
    lice:=lice+sqrt(p*(p-da)*(p*db)*(p-dc));
  End;
   if lice<min then
   Begin
     min:=lice;
     minnr:=num;
     minm:=c;
   End else
   if lice=min then
   Begin
    if c<minnr then
    Begin
      minm:=c;
      minnr:=num;
    End;
   End;
 Until False;
End.
