# Arup Guha
# 1/16/2024
# Solution to Kattis Problem: Planting Trees
# https://open.kattis.com/problems/plantingtrees
# Illustrates a Greedy Algorithm

# Get # of trees.
n = int(input())

# Get each time and sort in reverse order.
nums = [int(x) for x in input().split()]
nums.sort()
nums.reverse()

# Take the max of when each tree is ready.
res = 0
for i in range(n):
    res = max(res, i+2+nums[i])

print(res)
