Problem D: 【青科赛初中组】连号

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:3 Solved:3

Description

输入长度为n的一个正整数序列,要求输出序列中最长连号的长度。 连号指在序列中,从小到大的连续自然数。 对于100%的数据,保证1≤n≤10^4,1≤ ai≤10^9

Input

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

Output

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

Sample Input Copy

10
1 5 6 2 3 4 5 6 8 9

Sample Output Copy

5