#include using namespace std; int main(){ int l,m,n,ans=0; cin>>l>>m>>n; m+=n/25; ans+=n%25; l+=m/4; ans+=m%4; ans+=l%10; cout<