def main(): L = int(input()) M = int(input()) N = int(input()) tmp = L // 25 M = M + tmp L = L - 25 * tmp tmp = M // 4 N = N + tmp M = M - 4 * tmp O = 0 tmp = N // 10 O = O + tmp N = N - 10 * tmp print(sum((L,M,N))) if __name__ == '__main__': main()