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