program monoton;
const prob='monoton';
var fin,fout:text;
n,m,d,i,j,k:longint;
x,y:array[0..100010] of longint;
h:array[0..100010] of double;

function sar(i,j,k:longint):longint;
begin
sar:=x[i]*y[j]+x[j]*y[k]+x[k]*y[i]-x[j]*y[i]-x[k]*y[j]-x[i]*y[k];
end;
begin
assign(fin,prob+'.in'); reset(fin);
assign(fout,prob+'.out'); rewrite(fout);
readln(fin,n,d);
for i:=1 to n do
readln(fin,x[i],y[i]);
close(fin);
x[n+1]:=x[1]; y[n+1]:=y[1];
if n>7000 then begin writeln(fout,'infinit'); close(fout); halt(0); end;
for i:=1 to n+1 do
begin
for j:=1 to n do
if ((x[j]>=x[i])and(x[j+1]<=x[i]))or((x[j]<=x[i])and(x[j+1]>=x[i])) then
if sar(i,j,j+1)<>0 then
h[i]:=(y[j]-y[j+1])/(x[j]-x[j+1])*(x[i]-x[j])+y[j]-y[i];
end;

k:=0;
for i:=1 to n do
if (h[i]=d)and(h[i+1]=d) then begin writeln(fout,'infinit'); close(fout);
halt(0); end else
if h[i]=d then inc(k) else
if (h[i]<d)and(h[i+1]>d) then inc(k) else
if (h[i]>d)and(h[i+1]<d) then inc(k);
writeln(fout,k);
close(fout);
end.