#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

const int base = 10;
#define sz(s) int(s.size())

struct bigint
{
	int val[10001],l;
	bigint():l(0) {}
	int& operator[](int ind) { return val[ind]; }
	int operator[](int ind) const { return val[ind]; }	
};

inline bigint operator+(const bigint& a,const bigint& b)
{
	bigint r;
	int i = 0;
	long long c = 0;
	for (; i < a.l || i < b.l || c > 0; ++i)
	{
		if (i<a.l) c += a[i];
		if (i<b.l) c += b[i];
		r[i] = c%base;
		c = c/base;
	}
	r.l = i;
	return r;
}

inline bigint operator-(const bigint& a,const bigint& b)
{
	bigint r;
	r.l = a.l;
	int c = 0;
	for (int i = 0; i < a.l; ++i)
	{		
		r[i] = a[i] + c;
		if (i<b.l) r[i] -= b[i];
		if (r[i]<0) r[i] += base, c = -1; else c = 0;
	}
	while(r.l>1 && r[r.l-1]==0) --r.l;
	return r;
}

void scan(string s,bigint& a)
{	
	a.l = sz(s);
	for (int i = sz(s)-1; i >= 0; --i)
		a[a.l-1-i] = s[i]-'0';
}

void print(const bigint& a)
{	
	cout << a[a.l-1];
	for (int i = a.l-2; i >= 0; --i)
		for (int j = base/10; j > 0; j /= 10)
			cout << (a[i]/j % 10);
	cout << endl;
}

bigint n,a,b;
string s;

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