Home => ProblemSet => 200.200-08:最长连号
Problem1524--200.200-08:最长连号

1524: 200.200-08:最长连号

Time Limit: 1 Sec  Memory Limit: 128 MB  Submit: 0  Solved: 9
[ Submit ] [ Status ] [ Creator: ][ 参考程序 ]

Description

输入长度为 n 的一个正整数序列,要求输出序列中最长连号的长度。
连号指在序列中,从小到大的连续自然数。

Input

第一行,一个整数 n。
第二行,n 个整数 ai,之间用空格隔开。

Output

一个数,最长连号的个数。

Sample Input Copy

10
1 5 6 2 3 4 5 6 8 9

Sample Output Copy

5

HINT



对于 100% 的数据,保证 1≤n≤104,1≤ai≤109

Source/Category