// Arup Guha
// 12/7/2024
// Solution to Kattis Problem: Planting Trees

import java.util.*;

public class plantingtrees {

	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int n = stdin.nextInt();
		
		// Create array and list.
		ArrayList<Integer> list = new ArrayList<Integer>();
		for (int i=0; i<n; i++) {
			int val = stdin.nextInt();
			list.add(val);
		}
		
		// Sorting in reverse order.
		Collections.sort(list, Collections.reverseOrder());
		
		// Answer based on first tree.
		int res = list.get(0) + 2;
		
		// Update as necessary.
		for (int i=1; i<n; i++)
			res = Math.max(res, list.get(i)+i+2);
			
		// Ta da!
		System.out.println(res);
	}
}