#include <stdio.h>
#include <math.h>
#include <algorithm>
#define Nmax 100005
#define eps 0.000001
#define INF 2147000000
using namespace std;

struct punct{ int x,y; } P[Nmax];
int ind[Nmax];
int N,D;

inline int cmp(int i,int j){
	return P[i].x < P[j].x;
}

inline double Abs(double x){ return x>0 ? x:-x; }
inline double Maxim(double x,double y){ return x>y ? x:y; }
inline double dist(int i3,int i1,int i2 ){
	double a,b,c,y;
	a=P[i1].y-P[i2].y;
	b=P[i2].x-P[i1].x;
	c=P[i1].x*P[i2].y - P[i2].x*P[i1].y;
	
	y=(-c-a*P[i3].x)/b;
	return Abs( y - (double)P[i3].y );
}	
inline int egal(double a,double b){
	return Abs(a-b) <= eps;
}

int main(){
	int i,i1,i2,p11,p22,p1,p2,sol=0,e_inf=0;
	double d1,d2,aux; // sau LL
	
	freopen("monoton.in","r",stdin);
	freopen("monoton.out","w",stdout);
	scanf("%d%d",&N,&D);
	for(i=1;i<=N;++i)
		scanf("%d%d",&P[i].x,&P[i].y), ind[i]=i;
	P[N+1]=P[1];
	P[0]=P[N];
	
	sort(ind+1,ind+N+1,cmp); // sort dupa x
	ind[N+1]=ind[1];
	ind[0]=ind[N];
	
	p1=ind[1]; p11=ind[1]-1;
	p2=ind[1]; p22=ind[1]+1;
	if( p11<=0 ) p11 += N;
	if( p22>N ) p22 -= N;
		
	for(i=1;i<N;++i){
		i1=ind[i];
		i2=ind[i+1];
		
		if( P[p1].x <= P[i1].x && P[i2].x<=P[p11].x );
		else{
			p1--, p11=p1-1;
			if( p1<=0 ) p1 += N;
			if( p11<=0 ) p11 += N;
		}
		if( P[p2].x <= P[i1].x && P[i2].x<=P[p22].x );
		else{
			p2++; p22=p2+1;
			if( p2>N ) p2 -= N;
			if( p22>N ) p22 -= N;
		}		
	
		d1=d2=0;
		d1=Maxim( dist(i1,p1,p11), dist(i1,p2,p22) );
		d2=Maxim( dist(i2,p1,p11), dist(i2,p2,p22) );
		if( d1>d2 ) aux=d1, d1=d2, d2=aux;
		
		if( d1<=(double)D && (double)D<=d2 ){
			if( egal( d1,d2 ) ){
				if( P[i1].x != P[i2].x ) e_inf=1;
				else if( egal(d1,D) ) sol++;
			}
			else sol++;
		}
	}
	
	if( e_inf ) printf("infinit\n");
	else printf("%d\n",sol);
	fclose(stdin); fclose(stdout);
	return 0;
}
