#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int main(){
    int a, b, c;
    cin >> a >> b >> c;
    cout << 21 - a - b - c << endl;
    return 0;
}
#include <iostream>
#include <vector>

using namespace std;
using llint = long long;
#define rep(i,n) for(int i=0;i<(n);++i);

int main() {
  llint a,b,c;
  cin >> a >> b >> c;
  cout << (7-a) + (7-b) + (7-c) << endl;
  return 0;
}