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