import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; /* * 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. */ /** * * @author cteam014 */ public class Amusement { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokenizer; int difference; int N; int[] sequence; public void solve() throws Exception { String line; while ((line = reader.readLine()) != null) { N = Integer.parseInt(line); if (N < 2) { reader.readLine(); System.out.println(1); continue; } sequence = new int[N + 1]; tokenizer = new StringTokenizer(reader.readLine()); for (int i = N; i > 0; i--) { sequence[i] = Integer.parseInt(tokenizer.nextToken()); } difference = sequence[1] - sequence[2]; int i = 2; while (i < sequence.length - 1 && sequence[i] - sequence[i + 1] == difference) { i++; } System.out.println(N - i + 1); } } public static void main(String[] args) throws Exception { new Amusement().solve(); } }