import java.util.Scanner; public class Chokin { public static void main(String[] args) { Scanner s = new Scanner(System.in); int L = s.nextInt(), M = s.nextInt(), N = s.nextInt(); s.close(); if(N/25 >= 1){ M += N/25; } if(M/4 >= 1){ L += M/4; } System.out.println(N%25 + M%4 + L%10); } }