#include<cstdio>
#include<algorithm>
using namespace std;
struct node
{
int times,money;
}a[105];
bool cmp(node x,node y)
{
return x.money+x.times < y.money+y.times;
}
int main()
{
int n,m,t;
scanf("%d%d%d",&n,&m,&t);
for(int i=1;i<=n;i++)
scanf("%d%d",&a[i].times,&a[i].money);
sort(a+1,a+n+1,cmp);
int i=1,ans=0;
while(m&&t)
{
if(a[i].money!=0)
{
a[i].money--;
m--;
if(a[i].times!=0)
{
a[i].times--;
t--;
}
}
else
{
i++;
ans++;
}
}
printf("%d\n",ans);
return 0;
}