L = int(input()) M = int(input()) N = int(input()) ans = 0 M += N//25 ans += N%25 L += M//4 ans += M%4 ans += L%10 print(ans)