#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000

typedef long long ll;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};

int D;
double V[16];

// n,Eを使わないで補完した時,f(n)を返す
double interpolate(int n, int E) {
    double sum = 0;
    for (int i = 0; i < D+3; i++) {
        if (i == n || i == E) continue;
        double p = V[i];
        for (int j = 0; j < D+3; j++) {
            if (j == i || j == n || j == E) continue;
            p = p * (double)(n-j) / (double)(i-j);
        }
        sum += p;
    }
    return sum;
}

bool outlier(int E) {
    for (int i = 0; i < D+3; i++) {
        if (i == E) continue;
        double p = interpolate(i, E);
        if (abs(p-V[i]) > 0.1) return false;
    }
    return true;
}

int main(void) {
    while (cin >> D && D) {
        for (int i = 0; i < D+3; i++) cin >> V[i];
        for (int i = 0; i < D+3; i++) {
            if (outlier(i)) {
                cout << i << endl;
                break;
            }
        }
    }
    return 0;
}