#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>

#include <string>

#define PROB "D"
#define VI vector<int>
#define pb push_back

using namespace std;
int sign = 1;
VI res;

VI longplus(VI a, VI b) {
  int i,s,c=0,as = a.size(),bs = b.size();
  if(as < bs) {
    VI t = a;
    a = b;
    b = t;
    int tmp = as;
    as = bs;
    bs = tmp;
  }
  reverse(a.begin(),a.end());
  reverse(b.begin(),b.end());
 /* 
    for(i=0;i<a.size();i++) cout << a[i];
    cout << endl;
      for(i=0;i<b.size();i++) cout << b[i];
      cout << endl;
       */
  VI r(as);
  for(i = 0; i < as;i++) {
    if(i >= bs) {
      s = a[i];
    }
    else {
      s = a[i] + b[i];
    }
    s += c;
    c = s / 10;
    s = s % 10;
    r[i] = s;
  }
  if(c) {
    r.pb(c);
  }
  reverse(r.begin(),r.end());
  res = r;
}

// 1 a>
int longcmp(VI a,VI b) {
   if(a.size() > b.size()) return 1;
   if(b.size() > a.size())  return -1;
   int i,n=a.size();
   for(i=0;i<n;i++) {
     if(a[i] > b[i]) return 1;
     if(a[i] < b[i]) return -1;
   }
   return 0;
}

// a - b es
VI longminus(VI a, VI b) {
  int i,s,c=0,as = a.size(),bs = b.size();
  int cmp = longcmp(a,b);
  if(!cmp) {
     VI r(1,0);
     return r;
  }
  if(cmp == -1) {
    VI t = a;
    a = b;
    b = t;
    int tmp = as;
    as = bs;
    bs = tmp;
    sign = -1;
  }
  reverse(a.begin(),a.end());
  reverse(b.begin(),b.end());
  /*
    for(i=0;i<a.size();i++) cout << a[i];
    cout << endl;
      for(i=0;i<b.size();i++) cout << b[i];
      cout << endl;
    */   
  VI r(as);
  for(i = 0; i < as;i++) {
    if(i >= bs) {
      s = a[i];
    }
    else {
      s = a[i] - b[i];
    }
    s -= c;
    c = 0;
    if(s < 0) {
      c = 1;
      s+=10;
    }
    r[i] = s;
  }
  reverse(r.begin(),r.end());
  /*
  for(i=0;i<r.size();i++) cout << r[i];
  cout << endl;
  */
  vector<int>::iterator itr;
  res.clear();
  bool isbegin = true;
  for(i=0;i<r.size();i++) {
    if(r[i] == 0 && isbegin) continue;
    isbegin= false;
    res.push_back(r[i]);
  }
}


VI toVI(string s) {
  int i,n = s.length();
  VI r(n);
  for(i=0;i<n;i++) {
    if(s[i] >= '0' && s[i] <= '9') r[i] = (int)(s[i] - '0');
  }
  return r;
}

int main() {
  freopen(PROB".in", "r", stdin);
  freopen(PROB".out", "w", stdout);
  VI a,b,n;
  string s;
  int i;
  cin >> s;
  n = toVI(s);
    cin >> s;
  a = toVI(s);
  cin >> s;
  b = toVI(s);
/*
for(i=0;i<a.size();i++) cout << a[i];
  cout << endl;
for(i=0;i<b.size();i++) cout << b[i];
  cout << endl;
  */
  longminus(n,a);
   //for(i=0;i<res.size();i++) cout << res[i];
   VI res2;
   for(i=0;i<res.size();i++) {
     res2.pb(res[i]);
   }
  longplus(res2,b);
  for(i=0;i<res.size();i++) cout << res[i];
  return 0;
}
