#include <iostream>
using namespace std;

int main() {
	int a, b, c, s=0;
	cin >> a >> b >> c;
	s += c%25;
	b += c/25;
	s += b%4;
	a += b/4;
	s += a%10;
	cout << s << endl;
	return 0;
}