#include <bits/stdc++.h>
using namespace std;
int linear_search(vector<int> a, int k){
for(int i=0; i<a.size(); i++){
if(a[i] == k) return i;
}
return -1;
}
int main()
{
int n; cin >> n;
vector<int> a(n);
for(int i=0; i<n; i++){
cin >> a[i];
}
cout << linear_search(a, 5);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbGluZWFyX3NlYXJjaCh2ZWN0b3I8aW50PiBhLCBpbnQgayl7CiAgICBmb3IoaW50IGk9MDsgaTxhLnNpemUoKTsgaSsrKXsKICAgICAgICBpZihhW2ldID09IGspIHJldHVybiBpOwogICAgfQogICAgcmV0dXJuIC0xOwp9CgoKaW50IG1haW4oKQp7CiAgICBpbnQgbjsgY2luID4+IG47CiAgICB2ZWN0b3I8aW50PiBhKG4pOwogICAgZm9yKGludCBpPTA7IGk8bjsgaSsrKXsKICAgICAgICBjaW4gPj4gYVtpXTsKICAgIH0KICAgIGNvdXQgPDwgbGluZWFyX3NlYXJjaChhLCA1KTsKfQo=