l = int(input()) m = int(input()) n = int(input()) m += n // 25 n = n % 25 l += m // 4 m = m % 4 l = (l % 10) print(n + m + l)