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