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

int main(){
    int l,m,n;
    cin >> l;
    cin >> m;
    cin >> n;
    
    int ans=0;
    m += n/25;
    ans += n%25;
    l += m/4;
    ans += m%4;
    ans += l%10;
    
    cout << ans << endl;
}