#include <bits/stdc++.h>
using namespace std;
int v[10000];
int main(){
ifstream f("numere.in");
ofstream g("numere.out");
int i, x;
while(f>>x){
if(x<10000)
v[x]=1;
}
for (i=9999; i>=1; i--){
if (v[x]==0)
cout<<i<<endl;
f.close();
g.close();
return 0;
}
}