In the town of Pirates, Captain Jack is the best pirate. Captain Smith is jealous of Jack's popularity. So he challenged Jack to solve the following puzzle:
Given an array A, find the length of the largest contiguous sub-array such that the difference between any two consecutive elements in the sub-array is 1. Captain Jack is a little confused, so he called you, a programmer, for solving this puzzle.

INPUT

First line of input contains a number N i.e. the number of elements in array A. The next line contains N space separated integers representing elements of array.

OUTPUT

Print the largest length of contiguous sub-array satisfying the above given property.

CONSTRAINTS

1 ≤ N ≤ 100000     
0 ≤ A[ i ] ≤ 100000 

SAMPLE INPUT
6
1 3 5 7 8 9

SAMPLE OUTPUT
3
t=input()

l=map(int,raw_input().split())

z=len(l)

pre=l[0]
count=0
ans=0
for i in xrange(1,z):
    if abs(pre-l[i])==1:
        #print "yesy", pre, l[i], count
        count+=1
        pre=l[i]
    else:
        if count>ans:
            ans=count
        count=0
        pre=l[i] 
if count>ans:
    ans=count           
if ans==0:
    print 0
else:
    print ans+1