import java.util.*; public class Exchange{ public static void main(String[] arg){ int n,m,l; Scanner sc = new Scanner(System.in); l = sc.nextInt(); m = sc.nextInt(); n = sc.nextInt(); while(l>=25){ l = l - 25; m++; } while(m>=4){ m = m - 4; n++; } while(n>=10){ n = n - 10; } System.out.println(n+m+l); } }