import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.util.Arrays; import java.util.stream.Stream; class Main { public static void main(String[] args) { no32(); } // No.32 貯金箱の憂鬱 private static void no32() { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // 100円硬貨 int $100; // 25円硬貨 int $25; // 1円硬貨 int $1; try { String L = reader.readLine(); $100 = Integer.parseInt(L); String M = reader.readLine(); $25 = Integer.parseInt(M); String N = reader.readLine(); $1 = Integer.parseInt(N); reader.close(); } catch (IOException e) { throw new UncheckedIOException(e); } int total = 0; total += $1 - 25 * ($1 / 25); $25 += $1 / 25; total += $25 - 4 * ($25 / 4); $100 += $25 / 4; total += $100 - 10 * ($100 / 10); System.out.println(total); } }