#include<iostream>
#include<cstring>
using namespace std;
int head,t,k;
char a[10000001];
int main()
{
while((a[++t]=getchar())!='\n' and a[t]!=' ');
t--;
cin>>k;
for(int i=1;i<=k;i++)
{
head=1;
while(a[head]<=a[head+1])
{
head++;
}
if(head==t) t--;
else
{
for(int j=head;j<=t-1;j++)
{
a[j]=a[j+1];
}
t--;
}
}
int length=t;
if(a[1]=='0' and t<=5)
{
cout<<"0";
}
else
{
for(int i=1;i<=t;i++)
{
if(i==1)
{
while(a[i]=='0')
{
i++;
}
}
cout<<a[i];
}
}
}