#include <iostream>
#include <cstdio>
#include <set>
#define MAXN 100001
using namespace std;
set<unsigned long long int> coll;
unsigned long long int n,T;
struct cow{
unsigned long long int speed;
unsigned long long int place;
}p[MAXN];
unsigned long long int qread()
{
unsigned long long int num=0;
char a;
a=getchar();
while(a<'0' || a>'9')
a=getchar();
while(a>='0' && a<='9')
{
num=num*10+a-'0';
a=getchar();
}
return num;
}
void init()
{
n=qread();
T=qread();
for(unsigned long long int i=1;i<=n;++i)
{
p[i].place=qread();
p[i].speed=qread();
}
}
void work()
{
while(--T)
{
for(unsigned long long int i=n;i>=1;--i)
{
p[i].place+=p[i].speed;
if(p[i].place>p[i-1].place)
{
p[i].place=p[i-1].place;
p[i].speed=p[i].speed;
}
}
}
for(unsigned long long int i=1;i<=n;++i)
coll.insert(p[i].place);
printf("%d\n",coll.size());
}
int main()
{
freopen("cowjoga.in","r",stdin);
freopen("cowjoga.out","w",stdout);
init();
work();
fclose(stdin);
fclose(stdout);
return 0;
}