import java.io.*; import java.util.*; import java.math.*; class Main32 { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int l = Integer.parseInt(br.readLine()); // 100 int m = Integer.parseInt(br.readLine()); // 25 int n = Integer.parseInt(br.readLine()); // 1 m += n / 25; n %= 25; l += m / 4; m %= 4; l %= 10; System.out.println(l + m + n); } }