#include <cstdio>
#include <cmath>
#define NMAX 100005
#define prec 0.00001
#define INF 1000000005
int n,d,rez,exception,act;
struct pct{double x,y;};
pct A[NMAX];
double gx,gy;
double x3,y3,x4,y4;
void read()
{
	scanf("%d%d",&n,&d);
	int i,x,y;
	for (i=1; i<=n; i++)
	{
		scanf("%d%d",&x,&y);
		A[i].x=x; A[i].y=y;
		gx+=A[i].x; gy+=A[i].y;
	}
	A[n+1]=A[1]; A[n+2]=A[2];
	gx/=n; gy/=n;
}
inline double modul(double x)
{
	return x<0 ? -x: x;
}
inline int egal(double x,double y)
{
	return modul(x-y)<prec;
}
inline int semn(double x)
{
	if (x<0)
		return -1;
	return 1;
}
int cauta()
{
	int i,s=0;
	double a,b,c,a2,b2,c2;
	for (i=1; i<=n; i++)
	{
		a=A[i].y-A[i+1].y;
		b=A[i+1].x-A[i].x;
		c=A[i].x*A[i+1].y-A[i+1].x*A[i].y;
		if (egal(a*x3+b*y3+c,0) && egal(a*x4+b*y4+c,0))
		{
			exception=1;
			return INF;
		}
		a2=y3-y4; 
		b2=x4-x3;
		c2=x3*y4-x4*y3;
		if (egal(a*x3+b*y3+c,0) || egal(a*x4+b*y4+c,0) || egal(a2*A[i].x+b2*A[i].y+c2,0) || egal(a2*A[i+1].x+b2*A[i+1].y+c2,0))
		{
			s++;
			continue ;
		}
		if (semn(a*x3+b*y3+c)*semn(a*x4+b*y4+c)==-1 && semn(a2*A[i].x+b2*A[i].y+c2)*semn(a2*A[i+1].x+b2*A[i+1].y+c2)==-1)
			s++;
	}
	return s;
}
void solve1()
{
	int i;
	double m,m1,b,b1,x,y,val;
	for (i=1; i<=n; i++)
	{
		act=i;
		if (egal(A[i+1].x,A[i].x))
		{
			x3=A[i].x+d; y3=A[i].y; x4=A[i+1].x+d; y4=A[i+1].y;
			rez+=cauta();
			if (exception)
				return ;
			
			x3=A[i].x-d; y3=A[i].y; x4=A[i+1].x-d; y4=A[i+1].y;
			rez+=cauta();
			if (exception)
				return ;
		}
		else
		{
			m=(A[i+1].y-A[i].y)/(A[i+1].x-A[i].x);
			x=A[i].x; y=A[i].y;
			val=sqrt(m*m+1)*d;
			b=val-m*x+y;//caz 1
			m1=(double)-1/m; b1=A[i].y-m1*A[i].x; //dreapta perpendiculara 
			x3=(b1-b)/(m-m1); y3=m*x3+b;
			m1=(double)-1/m; b1=A[i+1].y-m1*A[i+1].x; 
			x4=(b1-b)/(m-m1); y4=m*x4+b; //(x1,y1)->(x2,y2) sunt cele 2 extremitati ale segmentului
			rez+=cauta();
			if (exception)
				return ;
			
			b=-m*x+y-val;//caz 2
			m1=(double)-1/m; b1=A[i].y-m1*A[i].x; //dreapta perpendiculara 
			x3=(b1-b)/(m-m1); y3=m*x3+b;
			m1=(double)-1/m; b1=A[i+1].y-m1*A[i+1].x; 
			x4=(b1-b)/(m-m1); y4=m*x4+b; //(x1,y1)->(x2,y2) sunt cele 2 extremitati ale segmentului
			rez+=cauta();
			if (exception)
				return ;
		}
	}
}
int main()
{
	freopen("monoton.in","r",stdin);
	freopen("monoton.out","w",stdout);
	read();
	if (n<=1000)
	{
		solve1();
		if (exception)
			printf("infinit\n");
		else
			printf("%d\n",(rez+1)/2);
		return 0;
	}
	return 0;
}
