import math x = int(input()) y = int(input()) z = int(input()) if math.floor(z / 25) >= 1: y += math.floor(z / 25) if math.floor(y / 4) >= 1: x += math.floor(y / 4) y = y % 4 if math.floor(x / 10) >= 1: x = x % 10 sum = x + y + z print(sum)