L = int(input()) M = int(input()) N = int(input()) Nm = N // 25 #1円硬貨を25円硬貨に両替 N = N % 25 #余りの1円硬貨 Ml = (M + Nm ) // 4 M = (M + Nm ) % 4 L = L + Ml print ( N + M + L)