a,b,c = $stdin.readlines
a = a.to_i
b = b.to_i
c = c.to_i

b += c/25
c %= 25
a += b/4
b %= 4
a %= 10

puts a+b+c