n = int(input()) lst = list(map(int,input().split())) x = 1 arr = [] for i in range(n-1): if lst[i+1]-lst[i]==1: x = x+1 else: arr.append(x) x = 1 print(max(arr))