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