#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<string.h>
using namespace std;
string a , b;
int ans[1000000];
void start()
{
int len = a.length()-b.length();
if(a.length()>= b.length())
{
for(int i = 0 ; i < len ; i ++)
b = '0' + b;
}
else
{
len = -len;
for(int i = 0 ; i < len ; i ++)
a = '0' + a;
}
}
int reduce(char a ,char b)
{
return (a-'0')-(b-'0');
}
int main(void)
{
cin>>a>>b;
start();
int flag = 0;
/*-------------------------------------------初始化a,b同位*/
for(int i = 0 ; i <= a.length()-1 ; i ++)
{
if((a[i]-'0') > (b[i]-'0'))
{
flag = 1;
break;
}
else if((a[i]-'0') < (b[i]-'0'))
{
string c = a;
a = b;
b = c;
flag = 2;
break;
}
}
int e_len = a.length()-1;
int cnt = 0;
/*-------------------------------------------判a,b大小*/
for(int i = e_len ; i >= 0 ; i --)
{
if(reduce(a[i],b[i]) >= 0)
ans[cnt ++] = reduce(a[i],b[i]);
else
{
ans[cnt ++] = reduce(a[i],b[i])+10;
int flag1 = a[i-1]-'0'-1;
a[i-1] = flag1+ '0';
}
}
if(flag == 2)
cout<<'-';
for(int i = cnt-1 ; i >= 0 ; i --)
{
//cout<<ans[i];
if(ans[i] != 0)
{
for(int j = i ; j >= 0 ; j --)
cout<<ans[j];
return 0;
}
}
cout<<"0"<<endl;
}