import java.io.*; // 処理 class Process { private PrintWriter printWriter; private int L; private int M; private int N; Process(PrintWriter printWriter, int L, int M, int N) { this.printWriter = printWriter; this.L = L; this.M = M; this.N = N; } // 結果を出力 void printResult() throws IOException { int numOf1000YenBills = 0; int exchangeCount = 0; // 1 円硬貨を 25 円硬貨に両替 exchangeCount = N / 25; N -= 25 * exchangeCount; M += exchangeCount; // 25 円硬貨を 100 円硬貨に両替 exchangeCount = M / 4; M -= 4 * exchangeCount; L += exchangeCount; // 100 円硬貨を 1000 円札に両替 exchangeCount = L / 10; L -= 10 * exchangeCount; numOf1000YenBills += exchangeCount; printWriter.println(L + M + N); } } public class Main { public static void main(String[] args) throws IOException { var bufferedReader = new BufferedReader(new InputStreamReader(System.in)); var printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); // 入力 int L = Integer.parseInt(bufferedReader.readLine().trim()); int M = Integer.parseInt(bufferedReader.readLine().trim()); int N = Integer.parseInt(bufferedReader.readLine().trim()); // Process クラスで処理を行う var process = new Process(printWriter, L, M, N); process.printResult(); // 各ストリームを閉じる // 出力ストリームを閉じるときに標準出力に文字を出力する bufferedReader.close(); printWriter.close(); } }