#include <bits/stdc++.h>
using namespace std;

int main(){
    int l,m,n;
    cin >> l >> m >> n;
    if(n >= 25) {
        m += (n / 25);
        n -= ((n / 25) * 25);
    }
    if(m >= 4) {
        l += (m / 4);
        m -= ((m / 4) * 4);
    }
    if(l >= 10) {
        l -= ((l / 10) * 10);
    }
    cout << n + m + l << endl;
}