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