                    const eps=1e-8;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                 double=extended;
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; cos1,sin1,centr:extended;
begin
   al:=al+pi/2; cos1:=cos(al); sin1:=sin(al);
   { writeln('cos= ',cos(al):0:6,'  sin= ',sin(al):0:6);
   } for i:=1 to q do a[i]:=xx[i]*cos1+yy[i]*sin1;
    centr:=xxx*cos(al)+yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);  xxx:=0;yyy:=0;
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

 { writeln(xxx:0:2,' == ',yyy:0:2);
 for i:=1 to q do writeln(xx[i]:0:0,' ',yy[i]:0:0);
  }
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

    {  writeln('al= ',al*180/pi:0:6,' q= ',q);

       writeln(good(q,al));
     }

      if good(q,al) then begin inc(pp);
      if al<pi then
      ccc[pp]:=al else ccc[pp]:=al-pi; {writeln('al= ',al:0:7);}  end;

   end;

  n:=1024*8;
  for i:=1 to pp do a[i]:=ccc[i];
 { for i:=1 to pp do write(a[i]:0:5,' '); writeln;
 } for i:=pp+1 to n do   a[i]:=besk;
  sort(a);
  a[0]:=-10000;
  for i:=1 to pp do if abs(a[i]-a[i-1])>eps then inc(ot);

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-8;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                 double=extended;
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
   al:=al+pi/2;
   { writeln('cos= ',cos(al):0:6,'  sin= ',sin(al):0:6);
   } for i:=1 to q do a[i]:=xx[i]*cos(al)+yy[i]*sin(al);
    centr:=xxx*cos(al)+yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);  xxx:=0;yyy:=0;
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

 { writeln(xxx:0:2,' == ',yyy:0:2);
 for i:=1 to q do writeln(xx[i]:0:0,' ',yy[i]:0:0);
  }
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

    {  writeln('al= ',al*180/pi:0:6,' q= ',q);

       writeln(good(q,al));
     }

      if good(q,al) then begin inc(pp);
      if al<pi then
      ccc[pp]:=al else ccc[pp]:=al-pi; {writeln('al= ',al:0:7);}  end;

   end;

  n:=1024*8;
  for i:=1 to pp do a[i]:=ccc[i];
 { for i:=1 to pp do write(a[i]:0:5,' '); writeln;
 } for i:=pp+1 to n do   a[i]:=besk;
  sort(a);
  a[0]:=-10000;
  for i:=1 to pp do if abs(a[i]-a[i-1])>eps then inc(ot);

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-10;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
   al:=al+pi/2;
   { writeln('cos= ',cos(al):0:6,'  sin= ',sin(al):0:6);
   } for i:=1 to q do a[i]:=xx[i]*cos(al)+yy[i]*sin(al);
    centr:=xxx*cos(al)+yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);  xxx:=0;yyy:=0;
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

 { writeln(xxx:0:2,' == ',yyy:0:2);
 for i:=1 to q do writeln(xx[i]:0:0,' ',yy[i]:0:0);
  }
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

    {  writeln('al= ',al*180/pi:0:6,' q= ',q);

       writeln(good(q,al));
     }

      if good(q,al) then begin inc(pp); ccc[pp]:=al; {writeln('al= ',al:0:7);}  end;

   end;

  n:=1024*8;
  for i:=1 to pp do a[i]:=ccc[i];
 { for i:=1 to pp do write(a[i]:0:5,' '); writeln;
 } for i:=pp+1 to n do   a[i]:=besk;
  sort(a);
  a[0]:=-10000;
  for i:=1 to pp do if abs(a[i]-a[i-1])>eps then inc(ot);

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-10;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
   al:=al+pi/2;
   { writeln('cos= ',cos(al):0:6,'  sin= ',sin(al):0:6);
   } for i:=1 to q do a[i]:=xx[i]*cos(al)+yy[i]*sin(al);
    centr:=xxx*cos(al)+yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);  xxx:=0;yyy:=0;
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

 { writeln(xxx:0:2,' == ',yyy:0:2);
 for i:=1 to q do writeln(xx[i]:0:0,' ',yy[i]:0:0);
  }
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

    {  writeln('al= ',al*180/pi:0:6,' q= ',q);

       writeln(good(q,al));
     }

      if good(q,al) then begin inc(pp);
      if al<pi then
      ccc[pp]:=al else ccc[pp]:=al-pi; {writeln('al= ',al:0:7);}  end;

   end;

  n:=1024*8;
  for i:=1 to pp do a[i]:=ccc[i];
 { for i:=1 to pp do write(a[i]:0:5,' '); writeln;
 } for i:=pp+1 to n do   a[i]:=besk;
  sort(a);
  a[0]:=-10000;
  for i:=1 to pp do if abs(a[i]-a[i-1])>eps then inc(ot);

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-7;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
   al:=al+pi/2;
   { writeln('cos= ',cos(al):0:6,'  sin= ',sin(al):0:6);
   } for i:=1 to q do a[i]:=xx[i]*cos(al)+yy[i]*sin(al);
    centr:=xxx*cos(al)+yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);  xxx:=0;yyy:=0;
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

 { writeln(xxx:0:2,' == ',yyy:0:2);
 for i:=1 to q do writeln(xx[i]:0:0,' ',yy[i]:0:0);
  }
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

    {  writeln('al= ',al*180/pi:0:6,' q= ',q);

       writeln(good(q,al));
     }

      if good(q,al) then begin inc(pp);
      if al<pi then
      ccc[pp]:=al else ccc[pp]:=al-pi; {writeln('al= ',al:0:7);}  end;

   end;

  n:=1024*8;
  for i:=1 to pp do a[i]:=ccc[i];
 { for i:=1 to pp do write(a[i]:0:5,' '); writeln;
 } for i:=pp+1 to n do   a[i]:=besk;
  sort(a);
  a[0]:=-10000;
  for i:=1 to pp do if abs(a[i]-a[i-1])>eps then inc(ot);

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-10;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
  { al:=al+pi/2; }
    for i:=1 to q do a[i]:=xx[i]*cos(al)-yy[i]*sin(al);
    centr:=xxx*cos(al)-yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

{  writeln(xxx:0:1,' == ',yyy:0:1);
 for i:=1 to q do writeln(xx[i]:0:1,' ',yy[i]:0:1);
}
 if q=0 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

     { writeln('al= ',al:0:6,' q= ',q);

       writeln(good(q,al));
      }

      if good(q,al) then inc(ot);

   end;

 writeln(ot);

 1: close (output);
end.

                    const eps=1e-10;
                    besk=4000000000000000000;
                     label 1,2,3,44;
                 type
                     mas=array[-200000..2*1000000+1] of extended;
var
ii,k,i,j,step,stepp:longint;
n,kkk,tt,l,kol,dl,i1,j1,imin,pp,m,n1,k1,w,mesto,jj,pl1,pl2,pl3:int64;
a3,b3,c3,t,mask,sum,t1,t2,cc,nn,modul,p,ot,pmin,tmax,minf,kk,gr1,gr2,tt1,nnn,d,raz1,raz2,v,s,st,q,gr:int64; flag1:boolean;
 zan:array[-10..1000000] of boolean;
 cha:char;
fuc,fac,kolali,kolbob,ali,bob,b1,a1:array[-10..300000] of int64;
bbbb,cccc:array[0..100000] of extended;
 ss,ss1:string;
f:array[0..225000,0..40] of int64;
al,xx1,yy1,xxx,yyy,t3:extended; ch:char;
x,y,stepen:array[-10..2000000] of int64;
zan1,zan2:array[-3000000..3000000] of boolean;

xx,yy,ll,rr,aa,ccc, c,a,b:mas; flag:boolean;  pl:longint;
procedure sl (k,l,m:longint);  {k- dlina, l,m - nachalo dvuh blokov}
begin
i:=l;j:=m; flag:=true; step:=0;while flag do begin
if ((a[i])<(a[j])) then begin begin b[l+step]:=a[i];b1[l+step]:=a1[i];end;
inc(step);inc(i);
{writeln('step=',step,' i=',i);} end;
if ((a[i])>=(a[j])) then begin begin b[l+step]:=a[j];b1[l+step]:=a1[j];end;
inc(step);inc(j);end;
if  ((i>=l+k) or (j>=m+k)) then flag:=false;
end;
if(i>=l+k) then repeat b[l+step]:=a[j];b1[l+step]:=a1[j];inc(step);inc(j);until (j>=m+k);
if(j>=m+k) then repeat b[l+step]:=a[i];b1[l+step]:=a1[i];inc(step);inc(i);until (i>=l+k);
end;
procedure sort(var c:mas);

begin

k:=1; repeat
l:=1;m:=k+l; repeat sl(k,l,m); l:=l+2*k;m:=m+2*k; until (l>=n); k:=k*2;
for i:=1 to n do begin a[i]:=b[i];a1[i]:=b1[i]; end;
until (k>=n);
end;

  function nod(a,b:int64):int64; var p,t:int64;
begin
a:=abs(a); b:=abs(b);
if (a>0)and(b>0) then
   begin while (b>0) do begin t:=a mod b;a:=b;b:=t;    end;
    p:=a;
   end else if a=0 then p:=b else p:=a;
nod:=p;
end;

function degg(a,k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=degg(a,k-1)*a mod modul else
   begin  p:=degg(a,k div 2); degg:=p*p mod modul;   end;

end;

 function  max(a,b:int64):int64;
 begin max:=a; if b>a then max:=b; end;
  function  min(a,b:int64):int64;
 begin min:=a; if b<a then min:=b; end;

 function phi(a,b:double):double; label 222;var p:double;
begin
  if (a>0)and (b>=0) then begin p:=arctan(b/a);goto 222; end;
  if (a<0) then begin p:=pi+arctan(b/a);goto 222; end;
  if (a>0)and (b<0) then begin p:=2*pi+arctan(b/a);goto 222; end;
  if (a=0)and (b>0) then begin p:=pi/2;goto 222; end;
  if (a=0)and (b<0) then begin p:=3*pi/2;goto 222; end;
  222: phi:=p;
end;

function good(q:longint;al:extended):boolean;
var fl:boolean; i,j:longint; centr:extended;
begin
  { al:=al+pi/2; }
    for i:=1 to q do a[i]:=xx[i]*cos(al)-yy[i]*sin(al);
    centr:=xxx*cos(al)-yyy*sin(al);
    n:=1; while n<q do n:=n*2;
    for i:=q+1 to n do a[i]:=besk;
    sort(a);
    fl:=true;
  {  for i:=1 to q do write(a[i]:0:3,' '); writeln;
  }  for i:=1 to q do if abs(a[i]+a[q+1-i]-2*centr)>eps then fl:=false;

 good:=fl;
end;

begin
 { assign(input,'input.txt');reset(input);
  assign(output,'output.txt');rewrite(output);
  }

      read(p);
    for i:=1 to p do read(x[i],y[i]);
    for i:=1 to p do begin xxx:=xxx+x[i]; yyy:=yyy+y[i]; end;
    xxx:=xxx/p;yyy:=yyy/p;
    for i:=1 to p do
      begin
         jj:=0;
         for j:=i+1 to p do
           begin
              flag:=true;
              if abs ((x[i]+x[j])/2-xxx)>eps then flag:=false;
              if abs ((y[i]+y[j])/2-yyy)>eps then flag:=false;
              if flag then   jj:=j;

           end;

          if jj>0 then begin zan[i]:=true; zan[jj]:=true;   end;

      end;

  for i:=1 to p do if not zan[i] then begin  inc(q); xx[q]:=x[i]; yy[q]:=y[i];  end;

{  writeln(xxx:0:1,' == ',yyy:0:1);
 for i:=1 to q do writeln(xx[i]:0:1,' ',yy[i]:0:1);
}
 if q<3 then begin writeln(-1); goto 1;  end;

 for ii:=1 to q do
   begin
      xx1:=(xx[1]+xx[ii])/2;  yy1:=(yy[1]+yy[ii])/2;
      al:=phi(xx1-xxx,yy1-yyy);

     { writeln('al= ',al:0:6,' q= ',q);

       writeln(good(q,al));
      }

      if good(q,al) then inc(ot);

   end;

 writeln(ot);

 1: close (output);
end.


uses math;
var n,kq,kc,sl:int64;
i:longint;
begin
//assign(input,'cc.inp');reset(input);
//assign(output,'cc.out');rewrite(output);
read(n);
if n >0 then
  n:=abs(n)mod 360
    else n:=-(abs(n)mod 360);
n:=(360-n) mod 360;
//writeln(n);
kq:=0;
kc:=min(abs(n),abs(360-n));
for i:=1 to 4 do
  begin
    n:=(n +90) mod 360;
    if min(abs(n),abs(360-n))<kc then
      begin
        kc:=min(abs(n),abs(360-n));
     //   writeln(kc,' ',i);
        kq:=i;
      end;
  end;
writeln(kq);
end.

 var n:int64;
begin
readln(n);
n:=n mod 360;
n:=(n+360) mod 360;
if (n<=45) or (n>=315) then writeln(0);
if (n>45) and (n<=135) then writeln(1);
if (n<315) and (n>225) then writeln(3);
if (n>135) and (n<=225) then writeln(2);
end.

var
  a, b: array[0..3000] of int64;j, k,q, n: int64;i: longint;st: string;

begin
  readln(n);n := n mod 360;
  if (n>=-45) and(n<=45) then write(0) else
  if (n<-45) and(n>-135) then write(3) else
  if (n<=-135) and(n>-225) then write(2) else
  if (n<=-225) and(n>-315) then write(1) else
  if (n<=-315)  then write(0) else
  if (n>45) and(n<=135) then write(1) else
  if (n>135) and(n<=225) then write(2) else
  if (n>225) and(n<315) then write(3) else write(0);

end.

var
	n	: int64;
	a	: integer;
begin
	readln(n);
	n:= n mod 360;
	if n<0 then
		n:=n+360;
	a:=n div 90;
	//writeln(n,' ',a);
	if (n mod 90 < 45) then
	begin
		//writeln('yes');
		case a of
		3 : writeln(3);
		2 : writeln(2);
		1 : writeln(1);
		0 : writeln(0);
		end;
	end else
	begin

		if (n mod 90 > 45) then
		begin
			//writeln('yes1');
			case a of
			3 : writeln(0);
			2 : writeln(3);
			1 : writeln(2);
			0 : writeln(1);
			end;
		end else
		begin
			//writeln('yes2');
			case a of
			3 : writeln(0);
			2 : writeln(2);
			1 : writeln(1);
			0 : writeln(0);
			end;
		end;
	end;
end.

      {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
 {  assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
  }
     read(n);
     n:=(n+1800000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
    if n>=359 then begin  write(0); goto 1;  end;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

var
  n:int64; t0,t1,t2,t3,min:longint;

function kk(x:int64):longint;
begin
  if x<0 then
    begin x:=-x; x:=x mod 360; x:=-x; end
    else x:=x mod 360;
  if x<-180 then inc(x,360);
  if x>180 then dec(x,360);
  exit(abs(x));
end;

begin
  readln(n); t0:=kk(n);
  t1:=kk(n-90); t2:=kk(n-180); t3:=kk(n-270);
  min:=t0;
  if t1<min then min:=t1;
  if t2<min then min:=t2;
  if t3<min then min:=t3;
  if min=t0 then begin writeln(0); halt; end;
  if min=t1 then begin writeln(1); halt; end;
  if min=t2 then begin writeln(2); halt; end;
  writeln(3);
end.

var n,k:int64;
n1,k1:int64;
a,b:double;
c,s:string;
i:integer;
begin
read(n);
n:=n mod 360;
 if n<0 then n:=360+n;
   k:=n mod 90;
   if n>=315 then write(0) else
   if k<=45 then write(n div 90) else
     write(n div 90 +1);

end.

program z_630_m;
var x:int64;
i,m,min,w,d,q:integer;
begin
readln(x);
w:=(-1)*(x mod 360);
if w>0 then w:=(-1)*(360-w);
min:=361;

for i:=0 to 3 do
begin
d:=abs(w+90*i);
q:=q+1;
if d>180 then d:=abs(360-d);
if d<min then
begin
min:=d;
m:=i;
end;
end;

writeln(m);
end.

var
  a, b: array[0..3000] of int64;j, k,q, n: int64;i: longint;st: string;

begin
  readln(n);n := n mod 360;
  k := 0;q := abs(n);if n=-180 then begin write(2);halt;end;
  n := n - 90;if (abs(n) < q) then begin
    k := 1;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 1;q := abs(n);
  end;
  n := n - 90;if (abs(n) < q) then begin
    k := 2;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 2;q := abs(n);
  end;
  n := n - 90;if (abs(n) < q) then begin
    k := 3;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 3;q := abs(n);
  end;
  write(k);

end.

var
  a, b: array[0..3000] of int64;j, k,q, n: int64;i: longint;st: string;

begin
  readln(n);n := n mod 360;
  k := 0;q := abs(n);
  n := n - 90;if (abs(n) < q) then begin
    k := 1;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 1;q := abs(n);
  end;
  n := n - 90;if (abs(n) < q) then begin
    k := 2;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 2;q := abs(n);
  end;
  n := n - 90;if (abs(n) < q) then begin
    k := 3;q := abs(n);
  end;if (abs(n + 360)) < q then begin
    k := 3;q := abs(n);
  end;
  write(k);

end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+45;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+46;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
     writeln(n div 90);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+1800000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+46;
     writeln(n div 90);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+45;
     writeln(n div 90);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

   {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+3600000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
    if n<=3 then   writeln(n div 90) else write(0);

   1:          close(output);
end.

      {$APPTYPE CONSOLE}
const nn=3; besk=2000000000000000000;
   nnn=2000000;  eps=1e-11; modul=1000000007;
 type matr=array[1..3,1..3] of extended;
   mat=^matr;
 label 1,2,3,4;

var i1,j1,k,step,kt,ppp,god,day,mon,mask,i0,j0,i,j,start,finish:longint;
aa,p,newdl,dloch,kol,shag,m,t,ii,jj,l,r,p3,pos,ll,bb,pp,tt,ot1,ot2,s,kold,n:int64;
xx,cc,q,t1,t2,p4,p1,p2,ot,dist1,vt,zap,ba,by,ay,kk,centr,koef:int64;
flag2,flag1,flag:boolean;
ch1,ch2,ch:char;
str:array[-10..12000] of matr;
ccc1,v,rr,h1,h2,h,r1,r2,aaa,bbb,ccc,hh,po,pt,doltek,dolpred:extended;
next,prev,x1,x2,y1,y2,d,och,newoch,f,x,y,fact,c,b,a,prost:array[-100000..1100000] of int64;
oldzan,oldmarked,zan: array[0..330006] of boolean;
gr:array[-1..1001,-1..1001] of int64;
agor,aver,ssumgor,ssumver,sgor,sver,udd,dostl,dostr: array[-100..600,-100..600] of int64;
det,ott :double;
dd:matr;
d3,d1,d2,dist,edin:matr;
ss,ss1,ss2:string;
za:array[-10..600,-10..600] of boolean;
marked,dost,newdost:array[-10..700000] of boolean;
ssnew:array[-10..1000000] of char;
pole:array[-10..610,-10..600] of char;
pr2,prloos,pr1,ppr,prob:array[-100..200000] of int64;

name:array[0..2000] of string;
function min (a,b:int64):int64;begin min:=b;if a<b then min:=a;  end;
function max (a,b:int64):int64;begin max:=b;if a>b then max:=a;  end;

 function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

function degg(p,deg:int64):int64; var pp,q:int64;
 begin if deg=0 then degg:=1 else begin   if odd(deg) then degg:=(degg(p,deg-1)*p) mod modul else
 begin q:=(degg(p,deg shr 1)) mod modul; degg:=(q*q) mod modul;   end; end;   end;

begin
  { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
   }
     read(n);
     n:=(n+1800000000000000000) mod 360;
    { writeln(n);
    } n:=n+44;
    if n>359 then begin  write(0); goto 1;  end;
    n:=n div 90;
    if n<=3 then   writeln(n) else write(0);

   1:          close(output);
end.

var
n,s:Qword;
i:qword;

begin
readln(n);
s:=0;
s:=trunc(n/210)*48;
n:=n mod 210;
i:=1;
while (i<=n) do begin
if (((i mod 2)<>0)and((i mod 3)<>0)and((i mod 5)<>0)and((i mod 7)<>0)) then
    s:=s+1;
i:=i+1;
end;
writeln(s);

end.

uses math;
var n,kq,kc,sl:int64;
i:longint;
begin
//assign(input,'cc.inp');reset(input);
//assign(output,'cc.out');rewrite(output);
read(n);
n:=(360-n) mod 360;
kq:=0;
kc:=min(abs(n),abs(360-n));
for i:=1 to 4 do
  begin
    n:=(n +90) mod 360;
    if min(abs(n),abs(360-n))>kc then
      begin
        kc:=min(abs(n),abs(360-n));
        kq:=i;
      end;
  end;
writeln(kq);
end.

uses math;
var n,kq,kc,sl:int64;
i:longint;
begin
//assign(input,'cc.inp');reset(input);
//assign(output,'cc.out');rewrite(output);
read(n);
if n <>0 then
  n:=abs(n)mod 360*n div(abs(N));
n:=(360-n) mod 360;
//writeln(n);
kq:=0;
kc:=min(abs(n),abs(360-n));
for i:=1 to 4 do
  begin
    n:=(n +90) mod 360;
    if min(abs(n),abs(360-n))<kc then
      begin
        kc:=min(abs(n),abs(360-n));
     //   writeln(kc,' ',i);
        kq:=i;
      end;
  end;
writeln(kq);
end.

uses math;
var n,kq,kc,sl:int64;
i:longint;
begin
//assign(input,'cc.inp');reset(input);
//assign(output,'cc.out');rewrite(output);
read(n);
n:=(360-n) mod 360;
//writeln(n);
kq:=0;
kc:=min(abs(n),abs(360-n));
for i:=1 to 4 do
  begin
    n:=(n +90) mod 360;
    if min(abs(n),abs(360-n))<kc then
      begin
        kc:=min(abs(n),abs(360-n));
     //   writeln(kc,' ',i);
        kq:=i;
      end;
  end;
writeln(kq);
end.

var
	n	: int64;
	a	: integer;
begin
	readln(n);
	n:= n mod 360;
	if n<0 then
		n:=n+360;
	a:=n div 90;
	//writeln(n,' ',a);
	if (n mod 90 < 45) then
	begin
		//writeln('yes');
		case a of
		3 : writeln(3);
		2 : writeln(2);
		1 : writeln(1);
		0 : writeln(0);
		end;
	end else
	begin

		if (n mod 90 > 45) then
		begin
			//writeln('yes1');
			case a of
			3 : writeln(0);
			2 : writeln(3);
			1 : writeln(2);
			0 : writeln(1);
			end;
		end else
		begin
			//writeln('yes2');
			case a of
			3 : writeln(1);
			2 : writeln(2);
			1 : writeln(1);
			0 : writeln(0);
			end;
		end;
	end;
end.

var n,k:int64;
n1,k1:int64;
a,b:double;
c,s:string;
i:integer;
begin
read(n);
n:=n mod 360;
 if n<0 then n:=360+n;
   k:=n mod 90;
   if k<=45 then write(n div 90) else
     write(n div 90 +1);

end.

var n:int64;
begin
readln(n);
n:=n mod 360;
n:=(n+360) mod 360;
if (n<=45) or (n>=315) then writeln(0);
if (n>45) and (n<=135) then writeln(1);
if (n<315) and (n>=225) then writeln(3);
if (n>135) and (n<225) then writeln(2);
end.