import java.util.*; public class PiggyBank { public static void main(String[] args){ Scanner scanner = new Scanner(System.in); try{ int Yen100 = scanner.nextInt(); int Yen25 = scanner.nextInt(); int Yen1 = scanner.nextInt(); int Amari = 0 ; if(Yen1>1000){ System.out.println("指定の範囲を超えています"); System.exit(0); } if(Yen25>1000){ System.out.println("指定の範囲を超えています"); System.exit(0); } if(Yen100>1000){ System.out.println("指定の範囲を超えています"); System.exit(0); } if(Yen1 >= 25){ Yen25 = Yen25 + Yen1/25; Amari = Yen1 % 25 ; }else{ Amari = Yen1; } if(Yen25 >= 4){ Yen100 = Yen100 + Yen25/4; Amari += Yen25 % 4; }else{ Amari += Yen25; } if(Yen100 >= 10){ Amari += Yen100 % 10; }else{ Amari += Yen100; } System.out.println(Amari); }catch(InputMismatchException e){ System.out.println("数字を入力してください。"); }catch(Exception E){ System.out.println("予期せぬエラーです"); } } }