#include"bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,m,n) for(ll i=(ll)m;i<(ll)n;i++)
#define Endl endl
#define pr(i,j) make_pair(i,j) 
const ll mod = 998244353;
const ll inf = 5e18;
const ld pi = 3.14159265358979;
int main() {
	ll a, b, c;
	cin >> a >> b >> c;
	b += (a / 25);
	a %= 25;
	c += (b / 4);
	b %= 4;
	ll d = (c / 10);
	c %= 10;
	cout << a + b + c<< endl;
}