#include<stdio.h>
#include<math.h>
int d;
double data[20];
bool wrong(int c){
    int i,j,check;
    if(c==0)check=1,i=2;
    else check=0,i=1;
    double ans=0.0,tmp;
    //printf("check=%d ",check);
    for(;i<d+3;i++){
        if(i==c)continue;
        tmp=data[i];
        //printf("tmp=data[%d]",i);
        if(c==0)j=2;
        else j=1;
        for(;j<d+3;j++){
                if(j==c)continue;
                if(j==i)continue;
                tmp*=(check-j);
                tmp/=(i-j);
                //printf("*(%d-%d)>%d",check,j,i-j);
        }
        ans+=tmp;
    }
    //printf("%lf %lf\n",ans,data[check]);
    if(fabs(ans-data[check])<1e-3)return true;
    else return false;
}
int main(){
    int i;
    while(scanf("%d",&d)&&d){
        for(i=0;i<d+3;i++)scanf("%lf",data+i);
        for(i=0;i<d+3;i++){
            if(wrong(i)){
                printf("%d\n",i);
                break;
            }
        }
    }
    return 0;
}