n = int(input()) m = [int(x) for x in input().split()] s = 1 while m[m.index(min(m))+1] - min(m) == 1: s += 1 print(s)