#include<stdio.h>

int main(void){
    int n;
    scanf("%d",&n);
    int a[n];
    for (int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    int rs = 0;
    int temp;
    for (int i=0; i<n; i++){
        temp = 1;
        for (int j=0; j<n; j++){
            if (j != i && a[j] % a[i] == 0) {
                temp = 0;
                break;
            }
        }
        if (temp){
            printf("%d\n", i + 1);
            return 0;
        }
    }
    printf("%d\n", rs);
    return 0;
}