if __name__ == "__main__": B = list(map(int, inpput().split())) for i in range(len(B)): if (i+1) != B[i]: print(i) exit()