#include <iostream>

int getNum(int x) {
    return 7 - x;
}

int main() {
    int a, b, c;
    std::cin >> a >> b >> c;

    int result = getNum(a) + getNum(b) + getNum(c);
    std::cout << result << std::endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,j,n) for(int i=j;i<n;i++)
#define readvec(v,n) for(int i=0;i<n;i++){cin>>v[i];}
#define MOD 1000000007
int main()
{
  int a,b,c;
  cin>>a>>b>>c;
  cout<<21-(a+b+c)<<"\n";
  return 0;
}
