H = int(input()) t = int(input()) O = int(input()) new_O = O % 25 count_t = t + O // 25 new_t = count_t % 4 count_H = H + t // 4 new_H = count_H % 10 count_T = H // 10 ans = new_O + new_t + new_H print(ans)