Олимпиадный тренинг

Задача 38251. Metro


Vanya does not really like people, but, unfortunately, he sometimes still has to take the subway. In such cases, two things help him: headphones with his favorite "Scoprions"; and the right place. Since Vanya wants to be as far away from all people as possible, the right place is considered to be the place from which the distance from the nearest neighbor will be the maximum possible in the car. There are N seats in the car, and they are all located along one wall, and the entrance to the car is at seat number 1. The seats go in a row, without gaps. Vanya understands that sometimes there can be several correct seats, and wants to sit in the correct seat closest to the entrance (that is, the correct seat with the minimum number).

Guess what place Vanya will take in the car.

Input
The first line contains the number N (1 ≤ N ≤ 105). The next line contains N numbers separated by spaces — 0 or 1. The number 0 indicates free space, 1 — busy; places are numbered from left to right. It is guaranteed that at least one place is free.

Imprint
Print the number of the seat where Vanya will sit.
Examples
# Input Output
1 8
1 0 1 0 0 1 0 1
2
2 7
0 1 0 0 0 1 0
4
3 4
0 0 0 1
1