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