package yukiCoder; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0032 { public static void main(String[] args) { BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); try { int currencyOf100 = Integer.parseInt(bufferedReader.readLine()); int currencyOf25 = Integer.parseInt(bufferedReader.readLine()); int currencyOf1 = Integer.parseInt(bufferedReader.readLine()); int ans = calculation(currencyOf100,currencyOf25,currencyOf1); System.out.println(ans); } catch (IOException e) { e.printStackTrace(); } } public static int calculation(int currencyOf100, int currencyOf25, int currencyOf1) { if (currencyOf100 == 0 && currencyOf25 == 0 && currencyOf1 == 0) { return 0; } if (currencyOf1 > 0) { int addcurrencyOf25 = currencyOf1 / 25; currencyOf1 = currencyOf1%25; currencyOf25 += addcurrencyOf25; } if (currencyOf25 >= 4) { int addCurrencyOf100 = currencyOf25 / 4; currencyOf25 = currencyOf25%4; currencyOf100 += addCurrencyOf100; } if (currencyOf100 >= 10) { currencyOf100 = currencyOf100%10; } return currencyOf1 + currencyOf25 + currencyOf100; } }