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