CPython lite logoProblemsContests

42. Linear Search #1

 n natural numbers are given. Write a program to find the index of the first occurrence of the number 1 among these numbers. Indexing starts from 0.


Input

The first line contains a natural number, n(1n1000).

The second line contains n numbers separated by spaces, ai(1ai1000).

Output

The solution of the problem in a single line. If the number 1 does not exist output 1.


Sample input 1

3
2 1 1

Sample output 1

1

Sample input 2

3
4 3 2

Sample output 2

-1

Login to be able to submit.

BasicData structuresLoops
314 / 12
Solved / unsolved count
1.0 s / 512 MB
Limits