#include using namespace std; using ll = long long; using P = pair; #define rep2(i,a,n) for(int i = (a);i < (n);i++) #define rep(i,n) rep2(i,0,n) #define INF (1LL << 60) int main(void){ int l,m,n; cin >> l >> m >> n; if(n >= 25){ m += (n / 25); n %= 25; } if(m >= 4){ l += (m / 4); m %= 4; } cout << (l/10)+(l%10)+m+n << endl; }