B = list(map(int, input().split())) print(10 * (1 + 10) // 2 - sum(B))