import java.util.Scanner;

public class No26 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int L = sc.nextInt();
		int M = sc.nextInt();
		int N = sc.nextInt();
		
		int count1= N/25;
		N = N - count1*25;
		M = M + count1;
		
		int count2 = M/4;
		M = M - count2*4;
		L = L + count2;
		int count3 = L/10;
		L = L - count3*10;
		
		System.out.println(L+M+N);	
		

	}

}