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.
The first line contains a natural number, n(1≤n≤1000).
The second line contains n numbers separated by spaces, ai(1≤ai≤1000).
The solution of the problem in a single line. If the number 1 does not exist output −1.
3 2 1 1
1
3 4 3 2
-1
Login to be able to submit.