#include <iostream>
#include <cstdio>
using namespace std;
class BigInt{
	private:
		int base;
		int v[1000];
		int size;
		void qwq(){
			int i=0;
			while (i<size)
				if (v[i]>=base){
					if (i==size-1){
						size++;
						v[i+1]=0;
					}
					v[i+1]+=v[i]/base;
					v[i]%=base;
				}else
				if (v[i]<0){
					v[i+1]--;
					v[i]+=base;
				}else ++i;
			while (size>0&&v[size-1]==0)--size;
		}
	public:
		BigInt(){
			memset(v,0,sizeof(v));
			size=0;
			base=10;
		}
		void scan(){
			char a[1000];
			scanf("%s",&a);
			int l=strlen(a);
			size=0;
			for (int i=l-1;i>=0;--i)v[size++]=a[i]-48;
		}
		void print(){
			for (int i=size-1;i>=0;--i)printf("%d",v[i]);
			printf("\n");
		}
		void operator+=(BigInt a){
			for (int i=0;i<min(size,a.size);++i)v[i]+=a.v[i];
			for (int i=min(size,a.size);i<a.size;++i)v[i]=a.v[i];
			size=max(size,a.size);
			qwq();
		}
		void operator-=(BigInt a){
			for (int i=0;i<a.size;++i)v[i]-=a.v[i];
			qwq();
		}
};
BigInt a,b,n;

int main(){
	freopen("d.in","r",stdin);
	freopen("d.out","w",stdout);
	n.scan();a.scan();b.scan();
	n-=a;
	n+=b;
	n.print();
	return 0;
}
