#include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define ll long long
void solve(){
    int a,b,c;
    cin >> a >> b >> c;
    int sum;
    sum=((7-a)+(7-b)+(7-c));
    cout << sum;
}
int main()
{
ios;
solve();
return 0;
}
#include <bits/stdc++.h>
using namespace std;
long long int bpow(long long int a,long long int b)
{
    if(b==0)
    return 1;
    long long int res=bpow(a,b/2);
    if(b%2)
    return res*res*a;
    else
    return res*res;
}
long long int bpowm(long long int x,long long int y,long long int m) 
{ 
    long long int res=1;
    x=x%m;
    if (x==0)
    return 0;
    while(y>0) 
    {
        if(y&1) 
        res=(res*x)%m; 
        y=y>>1; 
        x=(x*x)%m; 
    } 
    return res; 
} 
 
int main() {
    ios::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	int a,b,c;
	cin>>a>>b>>c;
	cout<<21-a-b-c<<endl;
	// your code goes here
	return 0;
}
