#include using namespace std; typedef long long ll; int main() { ll n; ios::sync_with_stdio(0); while (cin >> n) { vector v(n); for (int i = 0; i < n; i++) cin >> v[i]; if (n <= 2) { puts("1"); continue; } ll dif = v[n-2]-v[n-1]; int i; for (i = n-2; i >= 1; i--) { int newdif = v[i-1]-v[i]; if (newdif != dif) { break; } } cout << i+1 << endl; } }