s = raw_input().split() print s c = 1 for i in range(0,9): test =int(s[i]) if test != c: print c break c += 1