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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    long long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, m = 0, n = 0, p = 0, q = 0, mod = 1000000007, pi = 3.1415926535;
    string s1, s2;
    char moji;

    cin >> a >> b >> c;
    cout << 21-a-b-c << endl;
    return 0;
}
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <functional>

using namespace std;
int main(int argc, char *argv[]){
    int a;
    int b;
    int c;
    std::cin >> a >> b >> c;
    int result = 0;
    result += (7 - a);
    result += (7 - b);
    result += (7 - c);
    std::cout << result << std::endl;
    return 0;
}