#include using namespace std; int main() { int output; int amount[4]; const int rankup[] = {25,4,10}; for (int i = 0;i<=2;i++)cin >> amount[i]; for (int i = 0; i<=2;i++){ if (rankup[i]<=amount[i]){ amount[i+1] += (amount[i]/rankup[i]); amount[i] = amount[i]%rankup[i]; } } for (int i = 0; i<=2;i++)output+= amount[i]; cout << output << endl; }