import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) l = int(readline()) m = int(readline()) n = int(readline()) m += n // 25 n %= 25 l += m // 4 m %= 4 print(l % 10 + m + n)