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