#include using namespace std; int main() { int a, b, c, d, x, y; cin >> a >> b >> c >> d >> x >> y; for (int p = 100; p >= 0; p--) { int m = p + x;//数学 int e = p - y;//英语 if (m > 100) continue; if (e < 0) continue; int sum = a + b + c + d + m + e; if (sum % 6 == 0 && sum / 6 == p) { cout << p << endl; break; } } return 0; }