while 1:a=map(int,raw_input().split());n=map(int.__sub__,a[1:],a[:-1]);print[n[i:]==n[:-i]for i in range(len(n))].index(1)