using System;

namespace yukicoder
{
    class Program
    {
        static void Main(string[] args)
        {
          int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int c = int.Parse(Console.ReadLine());
            int e=0;
            int num = 0;

            if (c >= 25)
            {
                e = c / 25;
                b += e;
                c -= 25 * e;
            }
            if (b>=4)
            {
                e = b / 4;
                a += e;
                b -= 4 * e;
            }
            if (a >= 10)
            {
                e = a / 10;
                a -= 10 * e;
            }

            num = a + b + c ;
            Console.WriteLine(num.ToString());
        }
    }
}