#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  int ans=0;
  ans+=(7-a);
  ans+=(7-b);
  ans+=(7-c);
  cout << ans << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define cio ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define mod 1000000007
typedef long long ll;
//ll aa[6]={}
int main()
{
    cio;
    ll a,b,c;
    cin>>a>>b>>c;
    cout<<21-a-b-c<<endl;
}
