링크 : https://www.acmicpc.net/problem/9237
/*
문제 : 이장님 초대
링크 : https://www.acmicpc.net/problem/9237
*/
// _ _ _ _
// _ _ _
// _ _ _
// _ _
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int n ;
cin >> n;
vector<int> v;
for(int i = 0, tmp; i < n; i++){
cin >> tmp;
v.push_back(tmp);
}
sort(v.begin(), v.end(), greater<int>());
for(int i = 0; i < n; i++){
v[i] += i;
}
sort(v.begin(), v.end(), greater<int>());
cout << v[0] + 2;
return 0;
}