#include <bits/stdc++.h>
using namespace std;

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 <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <cassert>
using namespace std;

void solve(long long a, long long b, long long c)
{
    int arr[] = {6, 5, 4, 3, 2, 1};

    cout << arr[a - 1] + arr[b - 1] + arr[c - 1] << endl;
}

// Generated by 2.3.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long a;
    std::scanf("%lld", &a);
    long long b;
    std::scanf("%lld", &b);
    long long c;
    std::scanf("%lld", &c);
    solve(a, b, c);
    return 0;
}
