L = int(raw_input()) M = int(raw_input()) N = int(raw_input()) L = (L % 10 + M // 4) % 10 M = (M % 4 + N // 25) % 4 N = N % 25 print L + M + N