#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define print(v) for(auto &u:v) cout << u << " "
#define printp(v) for(auto e:v) cout<<e.first<<" "<<e.second<<endl;
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define pb push_back
void solve()
{
int n; cin >> n;
vector <ll> v((n/2)+2,0);
int arr[n];
for(int i=0; i<n; i++) {
ll e; cin >> e;
v[e]++;
}
auto ix = find(v.begin(), v.end(), 1);
cout << ix - v.begin() << endl;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
int t = 1;
while(t--)
{
solve();
}
return 0;
}