#include <algorithm>
#include <cstdio>
using namespace std;

#define sc second
#define fs first

#define DIM 100005

pair <int,int> v[DIM];
int N,D,nrt;

void read ()
{
    int i;

    scanf ("%d%d",&N,&D);
    for (i=1; i<=N; ++i)
        scanf ("%d%d",&v[i].fs,&v[i].sc);
    v[N+1]=v[1];
}

inline int intersect (int A1,int B1,int C1,int A2,int B2,int C2,int poz,int ind,int semn)
{
    double x,y;

    if (1LL*A1*B2==1LL*A2*B1 && 1LL*A1*C2==1LL*A2*C1)
        return -1;

    if (1LL*A1*B2==1LL*A2*B1 && 1LL*A1*C2!=1LL*A2*C1)
        return 0;

    if (!A1)
        swap (A1,A2), swap (B1,B2), swap (C1,C2);

    if (!A1)
    {
        x=0.0; y=(double)(-C1)/B1;

        if (x>=min (v[poz].fs,v[poz+1].fs) && x<=max (v[poz].fs,v[poz+1].fs) && y>=min (v[poz].sc,v[poz+1].sc) && y<=max (v[poz].sc,v[poz+1].sc))
            if (x>=min (v[ind].fs,v[ind+1].fs) && x<=max (v[ind].fs,v[ind+1].fs) && y>=min (v[poz].sc,v[poz+1].sc)+D*semn && y<=max (v[poz].sc,v[poz+1].sc)+D*semn)
                return 1;

        return 0;
    }

    y=(double)(1LL*A1*C2-1LL*A2*C1)/(1LL*A2*B1-1LL*A1*B2);
    x=(double)(y*(-B2)-C2)/A2;


    if (x>=min (v[poz].fs,v[poz+1].fs) && x<=max (v[poz].fs,v[poz+1].fs) && y>=min (v[poz].sc,v[poz+1].sc) && y<=max (v[poz].sc,v[poz+1].sc))
        if (x>=min (v[ind].fs,v[ind+1].fs) && x<=max (v[ind].fs,v[ind+1].fs) && y>=min (v[poz].sc,v[poz+1].sc)+D*semn && y<=max (v[poz].sc,v[poz+1].sc)+D*semn)
            return 1;

    return 0;
}

void solve ()
{
    long long A1,B1,C1,A2,B2,C2;
    int i,j,cnt;

    for (i=1; i<=N; ++i)
    {
        A1=v[i].sc-v[i+1].sc;
        B1=v[i+1].fs-v[i].fs;
        C1=1LL*v[i].fs*v[i+1].sc-1LL*v[i].sc*v[i+1].fs;

        for (j=i+1; j<=N; ++j)
        {
            A2=v[j].sc-v[j+1].sc;
            B2=v[j+1].fs-v[j].fs;
            C2=1LL*v[j].fs*v[j+1].sc-1LL*v[j].sc*v[j+1].fs;

            cnt=intersect (A1,B1,C1+D,A2,B2,C2,j,i,1);
            if (cnt<0)
            {
                printf ("infinit");
                return ;
            }

            nrt+=cnt;

            cnt=intersect (A1,B1,C1-D,A2,B2,C2,j,i,-1);
            if (cnt<0)
            {
                printf ("infinit");
                return ;
            }

            nrt+=cnt;
        }
    }

    printf ("%d",nrt);
}

int main ()
{
    freopen ("monoton.in","r",stdin);
    freopen ("monoton.out","w",stdout);

    read ();
    solve ();

    return 0;
}
