#include<iostream>
using namespace std;
int main()
{
    int L, M, N;
    cin >> L >> M >> N;
    while(N >= 25)
    {
        N -= 25;
        M++;
    }
    while(M >= 4)
    {
        M -= 4;
        L++;
    }
    while(L >= 10)
    {
        L -= 10;
    }
    cout << L + M + N << endl;
    return 0;
}