import java.util.*; /** * Created by btk on 2017/10/17. */ public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int L = sc.nextInt(); int M = sc.nextInt(); int N = sc.nextInt(); int ret = 0; ret+=N%25; M+=N/25; ret+=M%4; L+=M/4; ret+=L%10; System.out.println(ret); sc.close(); } }