import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int hundred = sc.nextInt();
        int quater = sc.nextInt();
        int one = sc.nextInt();
        quater += one / 25;
        one %= 25;
        hundred += quater / 4;
        quater %= 4;
        hundred %= 10;
        System.out.println(hundred + quater + one);
    }
}