#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
//#include <atcoder/convolution>
//#include <atcoder/modint>

#define bug(x) cout << "zdongdebug1: " << x << endl;
#define bug2(x, y) cout << "zdongdebug2: " << x << " " << y << endl;
#define bug3(x, y, z) \
  cout << "zdongdebug3: " << x << " " << y << " " << z << endl;
#define bug4(x, y, z, w) \
  cout << "zdongdebug4: " << x << " " << y << " " << z << " " << w << endl;
using namespace std;
// using Modint = atcoder::modint998244353;
typedef long long ll;
void ex_gcd(ll a, ll b, ll &d, ll &x, ll &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    ex_gcd(b, a % b, d, y, x);
    y -= a / b * x;
  }
}
ll inv(ll a, ll n) {
  ll d, x, y;
  ex_gcd(a, n, d, x, y);
  return d == 1 ? (x % n + n) % (n / d) : -1;
}
ll gcd(ll x, ll y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}

const int maxn = 1000005;
const int mod = 998244353;

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  // freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int x,y,z;
  cin>>x>>y>>z;
  cout<<21-x-y-z<<endl;
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int a,b,c;

int main(void){
    scanf("%d%d%d",&a,&b,&c);
    printf("%d\n",7-a+7-b+7-c);

    return 0;
}