{$N+}
const maxn = 100000; 
      eps = 1e-9;

var  rez, t, n, d, i, j, x1, x2, y1, y2, x3, x4, y3, y4, xl, xr, ir, il : longint;
     x, y : array[1..maxn] of longint;
     yl1, yl2, yr1, yr2, dl, dr : double;
     fin, fout:text;

function max(x, y: longint): longint;
begin
if x>y then max:=x else max:=y;
end;

function min(x, y: longint): longint;
begin
if x<y then min:=x else min:=y;
end;


begin
  assign(fin, 'monoton.in');  reset(fin);
  assign(fout,'monoton.out'); rewrite(fout);
  read(fin, n, d);
  for i := 1 to n do read(fin, x[i], y[i]);

  rez := 0;
  {determin cel mai din stanga si cel mai din dreapta punct}
  il := 1;  ir := 1;
  for i := 2 to n do
      begin
      if (x[i] < x[il]) then
         il := i;
      if (x[i] > x[ir]) then
         ir := i;
      end;

  {parcurg varfurile incepand din stanga; cu i parcurg jos, cu j sus}
  i := il; j := il;
  while (i <> ir) and (j <> ir) do
        begin
        {1-2 este latura i, i+1}
        x1 := x[i];  y1 := y[i];
        x2 := x[i mod n + 1]; y2 := y[i mod n + 1];

        {3 4 este latura j j-1}
        x3 := x[j];  y3 := y[j];
        x4 := x[(j + n - 2) mod n + 1]; y4 := y[(j + n - 2) mod n + 1];

        xl := max(x1, x3);  xr := min(x2, x4);
        if (xl < xr) then
           begin
           yl1 := 1.0 * (xl - x1) * (y2 - y1) / (x2 - x1) + y1;
           yl2 := 1.0 * (xl - x3) * (y4 - y3) / (x4 - x3) + y3;
           yr1 := 1.0 * (xr - x1) * (y2 - y1) / (x2 - x1) + y1;
           yr2 := 1.0 * (xr - x3) * (y4 - y3) / (x4 - x3) + y3;
           dl := abs(yl2 - yl1);
           dr := abs(yr2 - yr1);
           if (abs(dl - d) < eps) and (abs(dr - d) < eps) then
              begin
              writeln(fout, 'infinit');
              close(fout);
              halt;
              end;
           if (dl < d - eps) and (dr >= d - eps) then
              rez := rez + 1;
           if (dl > d + eps) and (dr <= d + eps) then
              rez := rez + 1;
           end;

        if (x2 < x4) then i := i mod n + 1
           else  j := (j + n - 2) mod n + 1;
        end;

  writeln(fout, rez);
  close(fout);
end.