Thumbtacks

No attempts yetTime limit1sMemory limit128 MB

Problem

Jas is on his way home and must cross a bridge, but someone has laid a straight line of thumbtacks across it. The bridge is so narrow that there is no way to step around them, so the thumbtacks have to be jumped over. They are not all packed together: here and there are spots where Jas can put his foot down.

The bridge is made of nn planks, and each plank may hold a thumbtack. Jas can stand on a plank without a thumbtack, but not on one that has a thumbtack. We want to know how strong a jump Jas needs in order to reach the other side of the bridge. The jump length is the maximum number of planks Jas can clear in a single jump.

Input

The first line contains one integer nn (1n1061 \le n \le 10^6), the number of planks that make up the bridge. The second line contains nn integers a1,a2,,ana_1, a_2, \dots, a_n, each equal to 00 or 11, where aia_i describes the ii-th plank: 00 if the plank has no thumbtack, 11 if it does.

Output

Print a single integer: the jump length Jas must have in order to get to the other side of the bridge.