#include<bits/stdc++.h>
using namespace std;
int a[1005]={0},b[1005]={0},c[1005]={0};
string st1,st2;
int main(){
cin>>st1>>st2;
int len1=st1.size();
int len2=st2.size();
int fh=0,l,zh=0,k=0;
//cout<<st1<<endl<<st2<<endl;
if(len1<len2)
{
l=len2;
fh=1;
//swap(st1,st2);
//swap(len1,len2);
}
else
{
if(len1>len2)
{
l=len1;
fh=0;
}
else
{
if(st1<st2)
{
l=len2;
fh=1;
//swap(st1,st2);
//swap(len1,len2);
//cout<<fh<<endl;
}
else
{
l=len1;
fh=0;
}
}
}
if(fh!=0)
{
swap(st1,st2);
swap(len1,len2);
}
reverse(st1.begin(),st1.end());
reverse(st2.begin(),st2.end());
//cout<<st1<<endl<<st2<<endl;
for(int i=0;i<len1;i++)
{
b[i]=st1[i]-'0';
//cout<<b[i]<<" b:"<<len1<<endl;
}
//cout<<len1<<endl;
for(int i=0;i<len2;i++)
{
c[i]=st2[i]-'0';
// cout<<c[i]<<" C:"<<len2<<endl;
}
//cout<<len2<<endl;
for(int i=0;i<l;i++)
{
//cout<<b[i]<<"-"<<c[i]<<"=";
a[i]=b[i]-c[i];
//cout<<a[i]<<endl;
if(a[i]<0)
{
b[i+1]--;
b[i]=b[i]+10;
i--;
}
}
//cout<<endl;
if(fh!=0)
cout<<'-';
for(int i=l-1;i>=0;i--)
{
zh=zh+a[i];
}
//cout<<"l:"<<l<<"zh:"<<zh<<endl;
for(int i=l-1;i>=0;i--)
{
if(zh!=0)
{
if(a[i]!=0 || k==1)
{
cout<<a[i];
k=1;
}
else
{
}
}
}
if(zh==0)
cout<<"0";
return 0;
}