#include <bits/stdc++.h>
#define pb push_back
#define sz size()
#define all(c) (c).begin(), (c).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MOD = 1e9 + 7;
const int maxn = 5e5 + 7;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    vector<int> cnt(7, 0);
    for(int i = 0; i < 3; i++){
        int x;
        cin >> x;
        cnt[x]++;
    }
    bool ok = true;
    for(int i = 0; i < 7; i++){
        if(cnt[i] == 3){
            ok = true;
            cout << i;
            return 0;
        }
        if(cnt[i] == 2){
            for(int j = 0; j < 7; j++){
                if(cnt[j] == 1)cout << j;
            }
            return 0;
        }
    }
    cout << 0;
    return 0;
}
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<cmath>
#include<iomanip>
#define pi 3.14159265358979323846
#define mod 1000000007
#define int long long
#define elif else if
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
signed main(){
  int n, a, b;
  cin >> n >> a >> b;
  cout << n - a + b << "\n";
}