#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <utility>
#include <vector>

#define DEBUG_PRINT(n) \
    (cout << "L" << __LINE__ << " " << #n << " = " << n << endl)

#define LOOP(n) for (int _i = 0; _i < (n); _i++)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, r, n) for (int i = (r); i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using std::map;
using std::vector;

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a == b)
        cout << c << endl;
    else if (a == c)
        cout << b << endl;
    else if (b == c)
        cout << a << endl;
    else
        cout << 0 << endl;

    return 0;
}

#include <bits/stdc++.h>

#define int long long
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

const unsigned int M = 1e9 + 7;

int32_t main() {
	fastio;

	int n, a, b;
	cin >> n >> a >> b;
	cout << (n - a) + b;

	return 0;
}
