L = int(input()) # 100円玉の枚数 M = int(input()) # 25円玉の枚数 N = int(input()) # 1円玉の枚数 M += N // 25 N = N % 25 L += M // 4 M = M % 4 L = L % 10 print(L + M + N)