import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		//100円硬貨の枚数
		int L = sc.nextInt();
		//25円硬貨の枚数
		int M = sc.nextInt();
		//1円硬貨の枚数
		int N = sc.nextInt();
		//1円硬貨を両替
		M += N / 25;
		N = N % 25;
		//25円硬貨を両替
		L += M / 4;
		M = M % 4;
		//100円硬貨を両替
		L = L % 10;
		//硬貨の合計枚数を求める
		int sum = N + M + L;
		System.out.println(sum);
	}
}