#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;
	int smallest = 0, biggest = n + 1, x;
	for (int i = 1; i < n; ++i) {
		cin >> x;
		if (biggest - x >= smallest) {
			biggest = x;
		} else {
		    smallest = x;
		}
	}
	if (biggest - smallest >= 2) {
		cout << smallest + 1;
	} else if (smallest == 0) {
		cout << n;
	} else if (smallest == n) {
	    cout << 1;
	}
}
