a = int(input()) b = int(input()) c = int(input()) ans = c%25 b += c//25 ans += b%4 a += b//4 ans += a%10 print(ans)