#include <bits/stdc++.h>
using namespace std;
char s[305], s1[305], s2[305];
int a[305], b[305], c[305], tmp[305];
int compare(int a[], int b[])
{
if ( a[0] > b[0] )
{
return 1;
}
if ( a[0] < b[0] )
{
return -1;
}
for ( int i = a[0] ; i > 0 ; i-- )
{
if ( a[i] > b[i] )
{
return 1;
}
if ( a[i] < b[i] )
{
return -1;
}
}
return 0;
}
void minu ( int a[] , int b[] )
{
for ( int i = 1 ; i <= a[0] ; i++ )
{
if ( a[i] < b[i] )
{
a[i+1]--;
a[i] = a[i] + 10;
}
a[i] = a[i] - b[i];
}
while ( a[a[0]] == 0 && a[0] > 0 )
{
a[0]--;
}
}
void numcpy ( int p[] , int q[] , int n )
{
for ( int i = 1 ; i <= p[0] ; i++ )
{
q[i+n-1] = p[i];
}
q[0] = p[0] + n - 1;
}
int main()
{
cin >> s;
a[0] = strlen(s);
for ( int i = 0 ; i < a[0] ; i++ )
{
a[a[0]-i] = s[i] - '0';
}
cin >> s;
b[0] = strlen(s);
for ( int i = 0; i < b[0] ; i++ )
{
b[b[0]-i] = s[i] - '0';
}
c[0] = a[0] - b[0] + 1;
for ( int i = c[0] ; i >= 1 ; i-- )
{
memset(tmp, 0 , sizeof(tmp));
numcpy(b, tmp, i);
while ( compare(a, tmp) >= 0 )
{
c[i]++;
minu(a, tmp);
}
}
while ( c[c[0]] == 0 && c[0] > 0 )
{
c[0]--;
}
for ( int i = c[0] ; i > 0 ; i-- )
{
cout << c[i];
}
return 0;
}