//No.32 貯金箱の憂鬱 import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; public class No32 { static final Scanner sc = new Scanner(System.in); static final PrintWriter out = new PrintWriter(System.out,false); static void solve() { int l = sc.nextInt(); int m = sc.nextInt(); int n = sc.nextInt(); m += n/25; l += m/4; l = l%10; m = m%4; n = n%25; out.println((l+m+n)); } public static void main(String[] args) { long start = System.currentTimeMillis(); solve(); out.flush(); long end = System.currentTimeMillis(); //trace(end-start + "ms"); sc.close(); } static void trace(Object... o) { System.out.println(deepToString(o));} }