#include int main(void){ int L; int M; int N; scanf("%d %d %d", &L, &M, &N); M += N / 25; N %= 25; L += M / 4; M %= 4; L %= 10; printf("%d", L + M + N); return 0; }