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(n>=25){ n = n - 25; m++; } while(m>=4){ m = m - 4; l++; } while(l>=10){ l = l - 10; } System.out.println(n+m+l); } }