// yukicoder #include using namespace std; int main() { vector vec(9); int sum = 0; for (int i = 0; i < 9; ++i){ cin >> vec[i]; sum += vec[i]; } cout << 55 - sum << "\n"; return 0; }