#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define all(x) (x).begin(),(x).end()
#define print(x) if(x)cout<<"YES\n";else cout<<"NO\n";
#define pb push_back
#define F first
#define S second
//#define mod 1000000007
#define mod 998244353
using namespace __gnu_pbds;
using namespace std;
void solve() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << 21 - a - b - c << "\n";
}
int main() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	fastio;
	int T = 1;
	// cin>>T;
	while (T--) {
		solve();
	}
}
#include <iostream>
#include <vector>

using namespace std;
using llint = long long;
#define rep(i,n) for(int i=0;i<(n);++i);

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