import java.util.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int L = sc.nextInt(); int M = sc.nextInt(); int H = sc.nextInt(); int h = H/25; M += h; int m = M/4; L += m; int l = L/10; int count = H-h*25 + M-m*4 + L-l*10; System.out.println(count); } }