#include <iostream>

using namespace std;

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

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

int findeven(std::vector<int> v)
{
    for(int i=0;i<v.size();i++)
    {
        if(v[i]%2==0)
            return i;
    }
    return -1;
}
 
int main()
{
#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
#endif
 
 
 
    /* code */
int a,b,c;
cin>>a>>b>>c;

int a1,b1,c1;

a1 = 7-a;
b1 = 7-b;
c1 = 7-c;
cout<<a1+b1+c1;



return 0;



}
