# include # include # include # include # include # include # include # include # include # include # include # include # include using namespace std; using LL = long long; constexpr int MOD = 1000000000 + 7; //足し算してオーバーフローで死なないように確認しようね constexpr int INF = 1000000000; const double PI = acos(-1); int main() { int coin[3]; for (int i = 0; i < 3; i++) cin >> coin[i]; int exchange[3] = { 10, 4, 25 }; int ans = 0; for (int i = 2; i >= 0; i--) { int tmp = coin[i] / exchange[i]; ans += coin[i] - tmp * exchange[i]; if (i > 0) coin[i - 1] += tmp; } cout << ans << endl; }