import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(br.readLine()); // 100 int b = Integer.parseInt(br.readLine()); // 25 int c = Integer.parseInt(br.readLine()); // 1 int b2 = b + (c / 25); int a2 = a + (b / 4); int sum = c - (c / 25) * 25 + b2 - (b2 / 4) * 4 + a2 - (a2 / 10) * 10; System.out.println(sum); } }