import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int oneH = sc.nextInt(); int tweF = sc.nextInt(); int oneC = sc.nextInt(); sc.close(); if(oneC>=25){ tweF += oneC/25; oneC = oneC%25; } if(tweF>=4){ oneH += tweF/4; tweF = tweF%4; } if(oneH>=10){ oneH = oneH%10; } System.out.println(oneH + tweF + oneC); }// mainmethod } // class