# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals L = input() M = input() N = input() c = 0 if L / 25 > 0: M += L / 25 c += L % 25 else: c += L if M / 4 > 0: N += M / 4 c += M % 4 else: c += M if N / 10 > 0: c += N % 10 print c