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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);



    int a, b, c;
    cin >> a >> b >> c;
    cout << (7-a) + (7-b) + (7-c);


    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define M1 1000000007
#define M2 998244353
#define INF 1e18
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<int>
#define vlli vector <long long>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
/********************************************************************/
const double pi = 3.1415926535;
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
/********************************************************************/
ll int gcd(ll int a,ll int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b); 
     
}
int main() {
	// your code goes here
	FAST();
	int a,b,c;
	cin>>a>>b>>c;
	cout<<21-(a+b+c)<<endl;
	
   
	return 0;
}
