//53:49
//???????????????????????????????????£??????submit????????????????????????????????????
#include <bits/stdc++.h>
using namespace std;

#define EQ(n,m) (abs((n)-(m)) < EPS * (abs(n) + abs(m)))

typedef vector<double> vec;
typedef vector<vec> mat;
const double EPS = 1e-9;

int D;
vec V;

int solve(){
    int checker = D+2;
    for(int outlier=0; outlier<D+2; outlier++){
        double c = 0;
        for(int i=0; i<D+2; i++) if(i != outlier){
            double t = 1;
            for(int j=0; j<D+2; j++) if(j != outlier && i != j)
                t *= double(checker - j)/(i - j);
            c += t * V[i];
        }
        //cout << c << " " << V[checker] << endl;
        if(abs(c - V[checker]) < 0.9)
            return outlier;
    }
    return checker;
}

int main(){
    while(cin >> D, D){
        V.resize(D+3);
        for(auto& v: V) cin >> v;
        cout << solve() << endl;
    }
    return 0;
}