import java.util.Scanner; public class changeMoney { public static void main(String[] args) { Scanner sn = new Scanner(System.in); int h = sn.nextInt(); int t = sn.nextInt(); int w = sn.nextInt(); int count; sn.close(); while (h >= 10 || t >= 4 || w >= 25) { if (w >= 25) { t += w / 25; w = w % 25; } else if (t >= 4) { h += t / 4; t = t % 4; } else if (h >= 10) { h = h % 10; } } count = h + t + w; System.out.println(count); } }