Kamina is interested in brotherly sequences. A brotherly sequence is a sequence ~S~ where for every index ~i~, ~|S[i-1]-S[i]| \le 2~ and ~|S[i]-S[i+1]| \le 2~. Given a sequence of numbers ~S~ of length ~N~ ~(3 \le N \le 100)~, what is the length of the longest contiguous brotherly subsequence it contains?
The first line of input will contain the integer ~N~.
The second line of input will contain ~N~ space-separated integers making up the sequence ~S~. The numbers in ~S~ are in the range ~[-1000, +1000]~.
The positive integer length of the longest brotherly subsequence in the sequence ~S~.
5 1 1 2 4 8
A subsequence of a sequence is a sequence that is formed by deleting some elements of the original sequence, but preserving the relative order of the remaining elements. A contiguous subsequence is a subsequence formed by deleting some prefix and some suffix of the sequence (possibly empty for either or both).