#line 1 "A.cpp"
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int n, a, b; scanf("%d%d%d", &n, &a, &b);

	printf("%d\n", n - a + b);
	return 0;
}

#include <bits/stdc++.h>
#define all(V) V.begin(),V.end()
#define pi 3.1415926535897932384626
#define fi fixed<<setprecision(13)
#define ll long long 
#define rep(i, n) for (int i = 0; i < (ll)(n); i++)
#define Rep(i, n) for (ll i = 1; i <=(ll)(n); i++)
#define reps(i,k,n) for (ll i = (ll)k; i < (ll)(n); i++)
#define mp make_pair
#define mt make_tuple
using namespace std;
using V = vector<vector<int>>;
using Vc = vector<vector<char>>;
using Vb = vector<vector<bool>>;
using P = pair<int,int>;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
template<class T> void chmin(T& a,T b){ if(a > b) a=b; }
template<class T> void chmax(T& a,T b){ if(a < b) a=b; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
const ll infll=1LL<<62;
const ll inf=1<<30;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {1, -1, 0, 0};
struct Edge{
  int to;
  ll w;
  Edge(int to,ll w) : to(to),w(w){}
};

using Graph = vector<vector<Edge>>;
int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  /*----------------------------------------------------*/
  /*忘れるな，イメージするのは常に最強の自分だ*/
  int a,b,c;
  cin >> a >> b >> c;
  if(a ==b&& b!=c) cout << c;
  else if(a ==c&& c!=b) cout << b;
  else if(b == c && c!=a)  cout << a;
  else if(a ==b && b==c) cout <<a;
  else cout << 0;
}
/*制約を確認しろllじゃなくて大丈夫か？*/
/* sample 保存





*/