/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: main.cpp * Author: cteam007 * * Created on October 28, 2017, 9:06 AM */ #include #define ll long long int using namespace std; ll arr[1002]; ll diff; int ind; int n; /* * */ int main() { ll a; while(cin>>n){ memset(arr,0,sizeof(arr)); for(int i=0;i>a; arr[i] = a; } if(n==1){ cout << "1" << endl; continue; } for(int i=n-1;i>=1;i--){ if(i==n-1){ diff = arr[i] - arr[i-1]; // cout << diff << ":" << endl; ind = i-1; } else{ // cout << arr[i] << " " << arr[i-1] << " "; if(arr[i] - arr[i-1] != diff){ ind = i; break; } else{ ind = i-1; } } } cout << (ind+1) << endl; } return 0; }