#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main() {
    int l,m,n,money = 0,ans = 0;
    cin >> l >> m >> n;
    money = l * 100 + m * 25 + n;
    money %= 1000;
    ans+= money / 100;
    money %= 100;
    ans += money / 25;
    money %= 25;
    ans += money;
    cout << ans << endl;
    return 0;
}