nums=list(map(int,input().split())) for i in range(9): if nums[i]!=i+1: print(i+1) break print(10)