import java.util.Scanner;

public class No32 {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);


		int l,m,n;

		do {
			l=sc.nextInt();		//100円硬貨の初期枚数
			m=sc.nextInt();		//25円硬貨の初期枚数
			n=sc.nextInt();		//1円硬貨の初期枚数
		}while(!((0<=l && l<=1000)||(0<=m && m<=1000)||(0<=n && n<=1000)));

		int T=0;				//1000円紙幣の枚数
		int L=0;				//100円硬貨の枚数
		int M=0;				//25円硬貨の枚数
		int N=0;				//1円硬貨の枚数

		M = n/25;				//1円硬貨を25円硬貨へ両替
		n = n%25;				//残った1円硬貨の枚数
		M = M+m;				//両替後の25円硬貨の枚数

		L = M/4;				//25円硬貨を100円硬貨へ両替
		m = M%4;				//残った25円硬貨の枚数
		L = L+l;				//両替後の100円硬貨の枚数

		T = L/10;				//100円硬貨を1000円紙幣へ両替
		l = L%10;				//残った100円硬貨の枚数
		T = T;					//両替後の1000円紙幣の枚数


		System.out.println(n+m+l);

	}

}