import java.util.Scanner; class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int l = scan.nextInt(); int m = scan.nextInt(); int n = scan.nextInt(); int m1, m25, m100, m1000; m25 = n / 25; m1 = n % 25; m100 = (m + m25) / 4; m25 = (m + m25) % 4; m1000 = (l + m100) / 10; m100 = (l + m100) % 10; System.out.println(m1 + m25 + m100); scan.close(); } }