import java.util.Scanner;

public class Amusement {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(System.in);

		while (sc.hasNext()) {
			int pocet = sc.nextInt();
			int[] posl = new int[pocet];

			for (int i = 0; i < pocet; i++) {
				posl[i] = sc.nextInt();
			}

			if (pocet == 1) {
				System.out.println(1);
			} else {

				int index = pocet;
				int rozdil = posl[pocet - 1] - posl[pocet - 2];

				for (int i = pocet - 1; i > 0; i--) {
					if (posl[i] - posl[i - 1] == rozdil) {
						index--;
					} else {
						break;
					}
				}

				System.out.println(index);

			}

		}

	}

}
