using namespace std;
#include <bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for(int (I)=(A);(I)<(B);++(I))
#define ALL(C) (C).begin(),(C).end()
inline void solve()
{
	int L,M,N;
	cin>>L>>M>>N;
	M+=(N/25);
	N%=25;
	L+=(M/4);
	M%=4;
	L%=10;
	cout<<(L+M+N)<<endl;
}
int main(int argc,char**argv)
{
	BEGIN
	solve();
	END
}