# Arup Guha
# 12/7/2024
# Planting Trees

# Get # of terms and read in list.
n = int(input())
vals = [int(x) for x in input().split()]

# Sort it.
vals.sort(reverse=True)

# Based on first tree.
res = vals[0] + 2

# Update as necessary based on the rest of the trees.
for i in range(1, n):
    res = max(res, vals[i]+i+2)

# Ta da!
print(res)
