import java.util.*; class Main { private static final String SPLIT_STR = " "; private static final int AMOUNT_X = 1000; private static final int AMOUNT_L = 100; private static final int AMOUNT_M = 25; private static final int AMOUNT_N = 1; public static void main(String[] args) { // Scanner生成 Scanner sc = new Scanner(System.in); // 入力設定 String input = null; List numList = new ArrayList<>(); for (int i = 0; i < 3; i++) { sc.reset(); input = sc.nextLine(); numList.add(Integer.parseInt(input)); } // Scannerクローズ sc.close(); /* メイン処理開始 */ // 変数初期化 int result = 0; int L = numList.get(0); int M = numList.get(1); int N = numList.get(2); int amount = 0; // 結果設定 amount = AMOUNT_L * L + AMOUNT_M * M + AMOUNT_N * N; amount %= AMOUNT_X; result += amount / AMOUNT_L; amount %= AMOUNT_L; result += amount / AMOUNT_M; amount %= AMOUNT_M; result += amount / AMOUNT_N; /* メイン処理終了 */ // 結果出力 System.out.println(result); } }