import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

public class Solution {

    public static void main(String[] args) throws IOException {
        IO io = new IO() ;
        int n = io.getInt() ;
        List<Integer> l = io.getIntegerArray(n) ;

        l.sort(Comparator.comparingInt(a -> a)) ;
        for(int i = l.size() - 1 ; i > 0 ; i--){
            if(l.get(i) != l.get(i - 1) + 1 && l.get(i) != (int)l.get(i - 1)){
                System.out.println(l.get(i)) ;
                return ;
            }
        }
        if(l.get(0) == 1)
            System.out.println(l.get(l.size() - 1) + 1) ;
        else
            System.out.println(2) ;
    }
}

class Utils {

    static int[][] fourDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}} ;
    static int[][] eightDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}} ;

    public static List<Integer> sieve(int n){
        boolean b[] = new boolean[n + 1] ;
        List<Integer> ans = new ArrayList<>() ;
        Arrays.fill(b, true) ;

        for(int i = 2 ; i <= n ; i++){
            if(b[i]){
                ans.add(i) ;
                for(int j = i*i ; j >= 0 && j <= n ; j += i){
                    b[j] = false ;
                }
            }
        }
        return ans ;
    }

    public static boolean isPrime(long n){
        long sqrt = (long)Math.sqrt(n) ;
        for(int i = 2 ; i <= sqrt ; i++){
            if(n % i == 0)
                return false ;
        }
        return true ;
    }

    public static long mod(long n){
        if(n > 0)
            return n % 1000000007 ;
        return (n + 2000000014) % 1000000007 ;
    }

    public static boolean isSqr(long n){
        int sqrt = (int) Math.sqrt(n) ;
        return n == (long)sqrt*sqrt ;
    }

    public static Utils.Pair getSlope(int x0, int y0, int x1, int y1){
        int a = y1 - y0, b = x1 - x0, g = (int)Utils.gcd(Math.abs(a), Math.abs(b)) ;
        if(g != 0){
            a /= g ;
            b /= g ;
        }
        if(a < 0){
            a *= -1 ;
            b *= -1 ;
        }
        else if(a == 0){
            b = 1 ;
        }
        return new Utils.Pair(a, b) ;
    }

    public static boolean inRange(long i, long l, long h){
        return i >= l && i <= h ;
    }

    public static boolean isValid(int i, int j, int n, int m){
        return i >= 0 && j >= 0 && i < n && j < m ;
    }

    public static void swap(List<Integer> ls, int i, int j){
        int temp = ls.get(i) ;
        ls.set(i, ls.get(j)) ;
        ls.set(j, temp) ;
    }

    public static long gcd(long a, long b){
        if(a < b)
            return gcd(b, a) ;
        else if(a == b || b == 0)
            return a ;
        else{
            return gcd(b, a % b) ;
        }
    }

    public static long subSum(long[] pre, int l, int h){
        return l == 0 ? pre[h]: pre[h] - pre[l - 1] ;
    }

    public static class Pair implements Comparable<Pair>{
        public int l, h ;

        public Pair(int a, int b) {
            this.l = a;
            this.h = b;
        }

        @Override
        public int compareTo(Pair o) {
            return l - o.l ;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "l=" + l +
                    ", h=" + h +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (l != pair.l) return false;
            return h == pair.h;
        }

        @Override
        public int hashCode() {
            int result = l;
            result = 31 * result + h;
            return result;
        }
    }

    public static void ifPrint(boolean test, Object ifValue, Object elseValue){
        System.out.println(test ? ifValue: elseValue) ;
    }

    public static void print(Character delim, Object... a){
        List<String> top = new ArrayList<>() ;
        for(Object aa: a)
            top.add(aa == null ? "null": aa.toString()) ;
        System.out.println(join(top, delim.toString())) ;
    }

    public static void print(Object... a){
        print(' ', a) ;
    }

    public static  <T extends Comparable<T>> int lowerBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else
                h = mid ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static <T extends Comparable<T>> int upperBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else if(arr[mid].compareTo(key) == 0)
                l = mid ;
            else
                h = mid ;
            if(h == l + 1)
                break ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static class IndexedElement<T> {
        int idx;
        T val;

        public IndexedElement(int idx, T val) {
            this.idx = idx;
            this.val = val;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }

    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(List<T> ip) {
        ArrayList<IndexedElement<T>> op = new ArrayList<>();
        for (int i = 0; i < ip.size(); i++) {
            op.add(new IndexedElement<>(i, ip.get(i)));
        }
        return op;
    }

    public static <T> String join(List<T> ls) {
        return join(ls, " ") ;
    }

    public static <T> String join(List<T> ls, String delim) {
        StringJoiner sj = new StringJoiner(delim);
        for (T a : ls)
            sj.add(a.toString());
        return sj.toString();
    }

    public static <T> void print2DArray(List<List<T>> mat) {
        for (List<T> m : mat) {
            System.out.println("{ " + join(m, ", ") + " }");
        }
    }

    public static  <T> void reverseArrray(T[] arr, int l, int h){
        while(l < h){
            T temp = arr[l] ;
            arr[l] = arr[h] ;
            arr[h] = temp ;
            l++ ;
            h-- ;
        }
    }
}

class IO {
    private BufferedReader br = null;
    private StringTokenizer st = null;

    public IO() {
        this(System.in);
    }

    public IO(InputStream is) {
        this.br = new BufferedReader(new InputStreamReader(is));
    }

    public List<String> getStringArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        if (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        List<String> res = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (!st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            res.add(st.nextToken());
        }
        return res;
    }
    public String getString() throws IOException {
        List<String> res = this.getStringArray(1);
        return res.size() == 0 ? "" : res.get(0);
    }

    public List<Integer> getIntegerArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Integer::parseInt).collect(Collectors.toList());
    }
    public Integer getInt() throws IOException {
        List<Integer> res = this.getIntegerArray(1);
        return res.size() == 0 ? 0 : res.get(0);
    }

    public List<Long> getLongArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Long::parseLong).collect(Collectors.toList());
    }
    public Long getLong() throws IOException {
        List<Long> res = this.getLongArray(1);
        return res.size() == 0 ? 0L : res.get(0);
    }

    public List<Double> getDoubleArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Double::parseDouble).collect(Collectors.toList());
    }
    public Double getDouble() throws IOException {
        List<Double> res = this.getDoubleArray(1);
        return res.size() == 0 ? 0.0 : res.get(0);
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

public class Solution {

    public static void main(String[] args) throws IOException {
        IO io = new IO() ;
        int n = io.getInt(), cur = 1 ;
        List<Integer> l = io.getIntegerArray(n) ;

        l.sort(Comparator.comparingInt(a -> a)) ;
        for(int i = 0 ; i < l.size() ; i++){
            if(l.get(i) >= cur)
                cur++ ;
        }
        System.out.println(cur) ;
    }
}

class Utils {

    static int[][] fourDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}} ;
    static int[][] eightDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}} ;

    public static List<Integer> sieve(int n){
        boolean b[] = new boolean[n + 1] ;
        List<Integer> ans = new ArrayList<>() ;
        Arrays.fill(b, true) ;

        for(int i = 2 ; i <= n ; i++){
            if(b[i]){
                ans.add(i) ;
                for(int j = i*i ; j >= 0 && j <= n ; j += i){
                    b[j] = false ;
                }
            }
        }
        return ans ;
    }

    public static boolean isPrime(long n){
        long sqrt = (long)Math.sqrt(n) ;
        for(int i = 2 ; i <= sqrt ; i++){
            if(n % i == 0)
                return false ;
        }
        return true ;
    }

    public static long mod(long n){
        if(n > 0)
            return n % 1000000007 ;
        return (n + 2000000014) % 1000000007 ;
    }

    public static boolean isSqr(long n){
        int sqrt = (int) Math.sqrt(n) ;
        return n == (long)sqrt*sqrt ;
    }

    public static Utils.Pair getSlope(int x0, int y0, int x1, int y1){
        int a = y1 - y0, b = x1 - x0, g = (int)Utils.gcd(Math.abs(a), Math.abs(b)) ;
        if(g != 0){
            a /= g ;
            b /= g ;
        }
        if(a < 0){
            a *= -1 ;
            b *= -1 ;
        }
        else if(a == 0){
            b = 1 ;
        }
        return new Utils.Pair(a, b) ;
    }

    public static boolean inRange(long i, long l, long h){
        return i >= l && i <= h ;
    }

    public static boolean isValid(int i, int j, int n, int m){
        return i >= 0 && j >= 0 && i < n && j < m ;
    }

    public static void swap(List<Integer> ls, int i, int j){
        int temp = ls.get(i) ;
        ls.set(i, ls.get(j)) ;
        ls.set(j, temp) ;
    }

    public static long gcd(long a, long b){
        if(a < b)
            return gcd(b, a) ;
        else if(a == b || b == 0)
            return a ;
        else{
            return gcd(b, a % b) ;
        }
    }

    public static long subSum(long[] pre, int l, int h){
        return l == 0 ? pre[h]: pre[h] - pre[l - 1] ;
    }

    public static class Pair implements Comparable<Pair>{
        public int l, h ;

        public Pair(int a, int b) {
            this.l = a;
            this.h = b;
        }

        @Override
        public int compareTo(Pair o) {
            return l - o.l ;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "l=" + l +
                    ", h=" + h +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (l != pair.l) return false;
            return h == pair.h;
        }

        @Override
        public int hashCode() {
            int result = l;
            result = 31 * result + h;
            return result;
        }
    }

    public static void ifPrint(boolean test, Object ifValue, Object elseValue){
        System.out.println(test ? ifValue: elseValue) ;
    }

    public static void print(Character delim, Object... a){
        List<String> top = new ArrayList<>() ;
        for(Object aa: a)
            top.add(aa == null ? "null": aa.toString()) ;
        System.out.println(join(top, delim.toString())) ;
    }

    public static void print(Object... a){
        print(' ', a) ;
    }

    public static  <T extends Comparable<T>> int lowerBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else
                h = mid ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static <T extends Comparable<T>> int upperBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else if(arr[mid].compareTo(key) == 0)
                l = mid ;
            else
                h = mid ;
            if(h == l + 1)
                break ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static class IndexedElement<T> {
        int idx;
        T val;

        public IndexedElement(int idx, T val) {
            this.idx = idx;
            this.val = val;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }

    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(List<T> ip) {
        ArrayList<IndexedElement<T>> op = new ArrayList<>();
        for (int i = 0; i < ip.size(); i++) {
            op.add(new IndexedElement<>(i, ip.get(i)));
        }
        return op;
    }

    public static <T> String join(List<T> ls) {
        return join(ls, " ") ;
    }

    public static <T> String join(List<T> ls, String delim) {
        StringJoiner sj = new StringJoiner(delim);
        for (T a : ls)
            sj.add(a.toString());
        return sj.toString();
    }

    public static <T> void print2DArray(List<List<T>> mat) {
        for (List<T> m : mat) {
            System.out.println("{ " + join(m, ", ") + " }");
        }
    }

    public static  <T> void reverseArrray(T[] arr, int l, int h){
        while(l < h){
            T temp = arr[l] ;
            arr[l] = arr[h] ;
            arr[h] = temp ;
            l++ ;
            h-- ;
        }
    }
}

class IO {
    private BufferedReader br = null;
    private StringTokenizer st = null;

    public IO() {
        this(System.in);
    }

    public IO(InputStream is) {
        this.br = new BufferedReader(new InputStreamReader(is));
    }

    public List<String> getStringArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        if (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        List<String> res = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (!st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            res.add(st.nextToken());
        }
        return res;
    }
    public String getString() throws IOException {
        List<String> res = this.getStringArray(1);
        return res.size() == 0 ? "" : res.get(0);
    }

    public List<Integer> getIntegerArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Integer::parseInt).collect(Collectors.toList());
    }
    public Integer getInt() throws IOException {
        List<Integer> res = this.getIntegerArray(1);
        return res.size() == 0 ? 0 : res.get(0);
    }

    public List<Long> getLongArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Long::parseLong).collect(Collectors.toList());
    }
    public Long getLong() throws IOException {
        List<Long> res = this.getLongArray(1);
        return res.size() == 0 ? 0L : res.get(0);
    }

    public List<Double> getDoubleArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Double::parseDouble).collect(Collectors.toList());
    }
    public Double getDouble() throws IOException {
        List<Double> res = this.getDoubleArray(1);
        return res.size() == 0 ? 0.0 : res.get(0);
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

public class Solution {

    public static void main(String[] args) throws IOException {
        IO io = new IO() ;
        int n = io.getInt() ;
        List<Integer> l = io.getIntegerArray(n) ;

        l.sort(Comparator.comparingInt(a -> a)) ;
        for(int i = l.size() - 1 ; i > 0 ; i--){
            if(l.get(i) != l.get(i - 1) + 1 && l.get(i) != (int)l.get(i - 1)){
                System.out.println(l.get(i) - 1) ;
                return ;
            }
        }
        if(l.get(0) == 1)
            System.out.println(l.get(l.size() - 1) + 1) ;
        else
            System.out.println(l.get(0) - 1) ;
    }
}

class Utils {

    static int[][] fourDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}} ;
    static int[][] eightDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}} ;

    public static List<Integer> sieve(int n){
        boolean b[] = new boolean[n + 1] ;
        List<Integer> ans = new ArrayList<>() ;
        Arrays.fill(b, true) ;

        for(int i = 2 ; i <= n ; i++){
            if(b[i]){
                ans.add(i) ;
                for(int j = i*i ; j >= 0 && j <= n ; j += i){
                    b[j] = false ;
                }
            }
        }
        return ans ;
    }

    public static boolean isPrime(long n){
        long sqrt = (long)Math.sqrt(n) ;
        for(int i = 2 ; i <= sqrt ; i++){
            if(n % i == 0)
                return false ;
        }
        return true ;
    }

    public static long mod(long n){
        if(n > 0)
            return n % 1000000007 ;
        return (n + 2000000014) % 1000000007 ;
    }

    public static boolean isSqr(long n){
        int sqrt = (int) Math.sqrt(n) ;
        return n == (long)sqrt*sqrt ;
    }

    public static Utils.Pair getSlope(int x0, int y0, int x1, int y1){
        int a = y1 - y0, b = x1 - x0, g = (int)Utils.gcd(Math.abs(a), Math.abs(b)) ;
        if(g != 0){
            a /= g ;
            b /= g ;
        }
        if(a < 0){
            a *= -1 ;
            b *= -1 ;
        }
        else if(a == 0){
            b = 1 ;
        }
        return new Utils.Pair(a, b) ;
    }

    public static boolean inRange(long i, long l, long h){
        return i >= l && i <= h ;
    }

    public static boolean isValid(int i, int j, int n, int m){
        return i >= 0 && j >= 0 && i < n && j < m ;
    }

    public static void swap(List<Integer> ls, int i, int j){
        int temp = ls.get(i) ;
        ls.set(i, ls.get(j)) ;
        ls.set(j, temp) ;
    }

    public static long gcd(long a, long b){
        if(a < b)
            return gcd(b, a) ;
        else if(a == b || b == 0)
            return a ;
        else{
            return gcd(b, a % b) ;
        }
    }

    public static long subSum(long[] pre, int l, int h){
        return l == 0 ? pre[h]: pre[h] - pre[l - 1] ;
    }

    public static class Pair implements Comparable<Pair>{
        public int l, h ;

        public Pair(int a, int b) {
            this.l = a;
            this.h = b;
        }

        @Override
        public int compareTo(Pair o) {
            return l - o.l ;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "l=" + l +
                    ", h=" + h +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (l != pair.l) return false;
            return h == pair.h;
        }

        @Override
        public int hashCode() {
            int result = l;
            result = 31 * result + h;
            return result;
        }
    }

    public static void ifPrint(boolean test, Object ifValue, Object elseValue){
        System.out.println(test ? ifValue: elseValue) ;
    }

    public static void print(Character delim, Object... a){
        List<String> top = new ArrayList<>() ;
        for(Object aa: a)
            top.add(aa == null ? "null": aa.toString()) ;
        System.out.println(join(top, delim.toString())) ;
    }

    public static void print(Object... a){
        print(' ', a) ;
    }

    public static  <T extends Comparable<T>> int lowerBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else
                h = mid ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static <T extends Comparable<T>> int upperBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else if(arr[mid].compareTo(key) == 0)
                l = mid ;
            else
                h = mid ;
            if(h == l + 1)
                break ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static class IndexedElement<T> {
        int idx;
        T val;

        public IndexedElement(int idx, T val) {
            this.idx = idx;
            this.val = val;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }

    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(List<T> ip) {
        ArrayList<IndexedElement<T>> op = new ArrayList<>();
        for (int i = 0; i < ip.size(); i++) {
            op.add(new IndexedElement<>(i, ip.get(i)));
        }
        return op;
    }

    public static <T> String join(List<T> ls) {
        return join(ls, " ") ;
    }

    public static <T> String join(List<T> ls, String delim) {
        StringJoiner sj = new StringJoiner(delim);
        for (T a : ls)
            sj.add(a.toString());
        return sj.toString();
    }

    public static <T> void print2DArray(List<List<T>> mat) {
        for (List<T> m : mat) {
            System.out.println("{ " + join(m, ", ") + " }");
        }
    }

    public static  <T> void reverseArrray(T[] arr, int l, int h){
        while(l < h){
            T temp = arr[l] ;
            arr[l] = arr[h] ;
            arr[h] = temp ;
            l++ ;
            h-- ;
        }
    }
}

class IO {
    private BufferedReader br = null;
    private StringTokenizer st = null;

    public IO() {
        this(System.in);
    }

    public IO(InputStream is) {
        this.br = new BufferedReader(new InputStreamReader(is));
    }

    public List<String> getStringArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        if (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        List<String> res = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (!st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            res.add(st.nextToken());
        }
        return res;
    }
    public String getString() throws IOException {
        List<String> res = this.getStringArray(1);
        return res.size() == 0 ? "" : res.get(0);
    }

    public List<Integer> getIntegerArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Integer::parseInt).collect(Collectors.toList());
    }
    public Integer getInt() throws IOException {
        List<Integer> res = this.getIntegerArray(1);
        return res.size() == 0 ? 0 : res.get(0);
    }

    public List<Long> getLongArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Long::parseLong).collect(Collectors.toList());
    }
    public Long getLong() throws IOException {
        List<Long> res = this.getLongArray(1);
        return res.size() == 0 ? 0L : res.get(0);
    }

    public List<Double> getDoubleArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Double::parseDouble).collect(Collectors.toList());
    }
    public Double getDouble() throws IOException {
        List<Double> res = this.getDoubleArray(1);
        return res.size() == 0 ? 0.0 : res.get(0);
    }
}


import java.io.*;
import java.util.*;
import java.util.stream.Collectors;

public class Solution {

    public static void main(String[] args) throws IOException {
        IO io = new IO() ;
        int n = io.getInt() ;
        List<Integer> l = io.getIntegerArray(n) ;

        l.sort(Comparator.comparingInt(a -> a)) ;
        for(int i = l.size() - 1 ; i > 0 ; i--){
            if(l.get(i) != l.get(i - 1) + 1 && l.get(i) != (int)l.get(i - 1)){
                System.out.println(l.get(i) - 1) ;
                return ;
            }
        }
        if(l.get(0) == 1)
            System.out.println(l.get(l.size() - 1) + 1) ;
        else
            System.out.println(2) ;
    }
}

class Utils {

    static int[][] fourDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}} ;
    static int[][] eightDirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}} ;

    public static List<Integer> sieve(int n){
        boolean b[] = new boolean[n + 1] ;
        List<Integer> ans = new ArrayList<>() ;
        Arrays.fill(b, true) ;

        for(int i = 2 ; i <= n ; i++){
            if(b[i]){
                ans.add(i) ;
                for(int j = i*i ; j >= 0 && j <= n ; j += i){
                    b[j] = false ;
                }
            }
        }
        return ans ;
    }

    public static boolean isPrime(long n){
        long sqrt = (long)Math.sqrt(n) ;
        for(int i = 2 ; i <= sqrt ; i++){
            if(n % i == 0)
                return false ;
        }
        return true ;
    }

    public static long mod(long n){
        if(n > 0)
            return n % 1000000007 ;
        return (n + 2000000014) % 1000000007 ;
    }

    public static boolean isSqr(long n){
        int sqrt = (int) Math.sqrt(n) ;
        return n == (long)sqrt*sqrt ;
    }

    public static Utils.Pair getSlope(int x0, int y0, int x1, int y1){
        int a = y1 - y0, b = x1 - x0, g = (int)Utils.gcd(Math.abs(a), Math.abs(b)) ;
        if(g != 0){
            a /= g ;
            b /= g ;
        }
        if(a < 0){
            a *= -1 ;
            b *= -1 ;
        }
        else if(a == 0){
            b = 1 ;
        }
        return new Utils.Pair(a, b) ;
    }

    public static boolean inRange(long i, long l, long h){
        return i >= l && i <= h ;
    }

    public static boolean isValid(int i, int j, int n, int m){
        return i >= 0 && j >= 0 && i < n && j < m ;
    }

    public static void swap(List<Integer> ls, int i, int j){
        int temp = ls.get(i) ;
        ls.set(i, ls.get(j)) ;
        ls.set(j, temp) ;
    }

    public static long gcd(long a, long b){
        if(a < b)
            return gcd(b, a) ;
        else if(a == b || b == 0)
            return a ;
        else{
            return gcd(b, a % b) ;
        }
    }

    public static long subSum(long[] pre, int l, int h){
        return l == 0 ? pre[h]: pre[h] - pre[l - 1] ;
    }

    public static class Pair implements Comparable<Pair>{
        public int l, h ;

        public Pair(int a, int b) {
            this.l = a;
            this.h = b;
        }

        @Override
        public int compareTo(Pair o) {
            return l - o.l ;
        }

        @Override
        public String toString() {
            return "Pair{" +
                    "l=" + l +
                    ", h=" + h +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;

            Pair pair = (Pair) o;

            if (l != pair.l) return false;
            return h == pair.h;
        }

        @Override
        public int hashCode() {
            int result = l;
            result = 31 * result + h;
            return result;
        }
    }

    public static void ifPrint(boolean test, Object ifValue, Object elseValue){
        System.out.println(test ? ifValue: elseValue) ;
    }

    public static void print(Character delim, Object... a){
        List<String> top = new ArrayList<>() ;
        for(Object aa: a)
            top.add(aa == null ? "null": aa.toString()) ;
        System.out.println(join(top, delim.toString())) ;
    }

    public static void print(Object... a){
        print(' ', a) ;
    }

    public static  <T extends Comparable<T>> int lowerBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else
                h = mid ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static <T extends Comparable<T>> int upperBound(T[] arr, int l, int h, T key){
        while(l < h){
            int mid = (l + h) / 2 ;
            if(arr[mid].compareTo(key) < 0)
                l = mid + 1 ;
            else if(arr[mid].compareTo(key) == 0)
                l = mid ;
            else
                h = mid ;
            if(h == l + 1)
                break ;
        }
        return arr[l].compareTo(key) >= 0 ? l: -1 ;
    }

    public static class IndexedElement<T> {
        int idx;
        T val;

        public IndexedElement(int idx, T val) {
            this.idx = idx;
            this.val = val;
        }

        @Override
        public String toString() {
            return "IndexedElement{" +
                    "idx=" + idx +
                    ", val=" + val +
                    '}';
        }
    }

    public static <T> ArrayList<IndexedElement<T>> getIndexedArray(List<T> ip) {
        ArrayList<IndexedElement<T>> op = new ArrayList<>();
        for (int i = 0; i < ip.size(); i++) {
            op.add(new IndexedElement<>(i, ip.get(i)));
        }
        return op;
    }

    public static <T> String join(List<T> ls) {
        return join(ls, " ") ;
    }

    public static <T> String join(List<T> ls, String delim) {
        StringJoiner sj = new StringJoiner(delim);
        for (T a : ls)
            sj.add(a.toString());
        return sj.toString();
    }

    public static <T> void print2DArray(List<List<T>> mat) {
        for (List<T> m : mat) {
            System.out.println("{ " + join(m, ", ") + " }");
        }
    }

    public static  <T> void reverseArrray(T[] arr, int l, int h){
        while(l < h){
            T temp = arr[l] ;
            arr[l] = arr[h] ;
            arr[h] = temp ;
            l++ ;
            h-- ;
        }
    }
}

class IO {
    private BufferedReader br = null;
    private StringTokenizer st = null;

    public IO() {
        this(System.in);
    }

    public IO(InputStream is) {
        this.br = new BufferedReader(new InputStreamReader(is));
    }

    public List<String> getStringArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        if (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        List<String> res = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            if (!st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            res.add(st.nextToken());
        }
        return res;
    }
    public String getString() throws IOException {
        List<String> res = this.getStringArray(1);
        return res.size() == 0 ? "" : res.get(0);
    }

    public List<Integer> getIntegerArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Integer::parseInt).collect(Collectors.toList());
    }
    public Integer getInt() throws IOException {
        List<Integer> res = this.getIntegerArray(1);
        return res.size() == 0 ? 0 : res.get(0);
    }

    public List<Long> getLongArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Long::parseLong).collect(Collectors.toList());
    }
    public Long getLong() throws IOException {
        List<Long> res = this.getLongArray(1);
        return res.size() == 0 ? 0L : res.get(0);
    }

    public List<Double> getDoubleArray(int n) throws IOException {
        if (n == 0)
            return new ArrayList<>();
        List<String> res = getStringArray(n);
        return res.stream().map(Double::parseDouble).collect(Collectors.toList());
    }
    public Double getDouble() throws IOException {
        List<Double> res = this.getDoubleArray(1);
        return res.size() == 0 ? 0.0 : res.get(0);
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
//		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		Integer[]x = new Integer[n];
		for(int i = 0; i < n; ++i)
           x[i] = sc.nextInt();

        Arrays.sort(x);

        int cr=1;
        for(int y: x)
			if(y >= cr)
				++cr;

//        for(int i=0;i<n;i++){
//        	if(x[i]>cr)
//        		{cr++;
//
//        		}else{
//        			break;
//        		}
//
//        }

        	System.out.println(cr);
	}
	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;

		Scanner(InputStream s) { br = new BufferedReader(new InputStreamReader(s)); }

		Scanner(String s) throws FileNotFoundException { br = new BufferedReader(new FileReader(s)); }

		String next() throws IOException
		{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		int nextInt() throws NumberFormatException, IOException { return Integer.parseInt(next()); }
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];

        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        int cr=1;
        for(int y: x)
			if(y >= cr)
				++cr;

//        for(int i=0;i<n;i++){
//        	if(x[i]>cr)
//        		{cr++;
//
//        		}else{
//        			break;
//        		}
//
//        }

        	System.out.println(cr);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];

        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        int cr=1;
        for(int i=0;i<n;i++){
        	if(x[i]>=cr)
        		{cr++;

        		}else{
        			continue;
        		}

        }

        	System.out.println(cr);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];

        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        int cr=1;
        for(int i=0;i<n;i++){
        	if(x[i]>=cr)
        		{cr++;

        		}else{
        			break;
        		}

        }

        	System.out.println(cr+1);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];
        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        x[0]=1;
        for(int i=0;i<n-1;i++){
        	if(x[i+1]>x[i]+1)
        		{x[i+1]=x[i]+1;

        		}

        }
        int f=0;
        for(int i=0;i<n-1;i++){
//        	System.out.print(x[i]+" ");
        	if(x[i+1]-x[i]>1){
        		System.out.println(x[i]+1);
        		return;
        }}

        	System.out.println(x[x.length-1]+1);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];
        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        int cr=1;
        for(int i=0;i<n;i++){
        	if(x[i]>=cr)
        		{cr++;

        		}

        }
        int f=0;
//        for(int i=0;i<n-1;i++){
////        	System.out.print(x[i]+" ");
//        	if(x[i+1]-x[i]>1){
//        		System.out.println(x[i]+1);
//        		return;
//        }}

        	System.out.println(cr);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];
        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        x[0]=1;
        for(int i=0;i<n-1;i++){
        	if(x[i+1]>x[i]+1)
        		{x[i+1]=x[i]+1;

        		}

        }
        int f=0;
//        for(int i=0;i<n-1;i++){
////        	System.out.print(x[i]+" ");
//        	if(x[i+1]-x[i]>1){
//        		System.out.println(x[i]+1);
//        		return;
//        }}

        	System.out.println(x[x.length-1]+1);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];

        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);

        int cr=0;
        for(int y: x)
			if(y >= cr)
				++cr;

//        for(int i=0;i<n;i++){
//        	if(x[i]>cr)
//        		{cr++;
//
//        		}else{
//        			break;
//        		}
//
//        }

        	System.out.println(cr);
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashSet;
import java.util.StringTokenizer;

public class start {

	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println((int)'a'+" "+(int)'A');

        int n=Integer.parseInt(bf.readLine());
        int x[]=new int [n];
        StringTokenizer st = new StringTokenizer(bf.readLine(), " ");

        for(int i=0;i<n;i++){
        	x[i]=Integer.parseInt(st.nextToken());
        }

        Arrays.sort(x);
        for(int i=0;i<n-1;i++){
        	if(x[i+1]>x[i]+1)
        		{x[i+1]=x[i]+1;

        		}

        }
        int f=0;
        for(int i=0;i<n-1;i++){
//        	System.out.print(x[i]+" ");
        	if(x[i+1]-x[i]>1){
        		System.out.println(x[i]+1);
        		return;
        }}

        	System.out.println(x[x.length-1]+1);
	}
}


import java.util.PriorityQueue;
import java.util.Scanner;

public class CF358B {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), curr = 1;
		PriorityQueue<Integer> a = new PriorityQueue<Integer>();
		for(int i = 0; i < n; i++)a.add(scan.nextInt());
		for(int i = 0; i < n; i++){
			if(a.peek() > curr)	curr++;
			a.poll();
		}
		System.out.println(curr+1);
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class CF358B {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), curr = 0;
		int[] a = new int[n];
		for(int i = 0; i < n; i++)a[i] = scan.nextInt();
		Arrays.sort(a);
		for(int i = 0; i < n; i++){
			if(a[i] > curr){
				curr++;
				a[i] = curr;
			}
		}
		System.out.println(curr+1);
	}

}


import java.util.PriorityQueue;
import java.util.Scanner;

public class CF358B {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), curr = 0;
		PriorityQueue<Integer> a = new PriorityQueue<Integer>();
		for(int i = 0; i < n; i++)a.add(scan.nextInt());
		for(int i = 0; i < n; i++){
			if(a.peek() > curr)	curr++;
			a.poll();
		}
		System.out.println(curr+1);
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class CF358B {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt(), curr = 1;
		int[] a = new int[n];
		for(int i = 0; i < n; i++)a[i] = scan.nextInt();
		Arrays.sort(a);
		for(int i = 0; i < n; i++){
			if(a[i] > curr){
				a[i] = curr+1;
				curr++;
			}
		}
		System.out.println(curr+1);
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Alyona_and_Mex {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		long[] arr = new long[(int) n];

		for (long i = 0; i < n; i++) {
			arr[(int) i] = sc.nextLong();
		}

		Arrays.sort(arr);
		long temp = arr[0];
		if (temp != 1) {
			System.out.println(2);
		} else {
			for (long i = 1; i < n; i++) {
				if ((arr[(int) i] - temp) > 1) {
					arr[(int) i] = arr[(int) i] - ((arr[(int) i] - temp) - 1);
					temp = arr[(int) i];

				} else {
					temp = arr[(int) i];
				}
			}

			System.out.println(arr[(int) (n -1)] + 1);
		}

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Alyona_and_Mex {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		long[] arr = new long[(int) n];

		for (long i = 0; i < n; i++) {
			arr[(int) i] = sc.nextLong();
		}

		Arrays.sort(arr);
		long temp = arr[0];
		for (long i = 1; i < n; i++) {
			if ((arr[(int) i] - temp) > 1) {
				arr[(int) i] = arr[(int) i] - ((arr[(int) i] - temp) - 1);
				temp = arr[(int) i];

			} else {
				temp = arr[(int) i];
			}
		}

		System.out.println(arr[(int) (n -1)] + 1);

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Alyona_and_Mex {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		long[] arr = new long[(int) n];

		for (long i = 0; i < n; i++) {
			arr[(int) i] = sc.nextLong();
		}

		Arrays.sort(arr);
		long temp = arr[0];
		if (temp != 1 && n == 1) {
			System.out.println(2);
		} else {
			for (long i = 1; i < n; i++) {
				if ((arr[(int) i] - temp) > 1) {
					arr[(int) i] = arr[(int) i] - ((arr[(int) i] - temp) - 1);
					temp = arr[(int) i];

				} else {
					temp = arr[(int) i];
				}
			}

			System.out.println(arr[(int) (n -1)] + 1);
		}

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Alyona_and_Mex1 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		//long[] arr = new long[(int) n];
		ArrayList <Long> arr = new ArrayList();   /* ********* ArrayList ************* */

		for (long i = 0; i < n; i++) {
			arr.add(sc.nextLong()) ;
		}

		//Arrays.sort(arr);
		Collections.sort(arr);
		long temp = arr.get(0);
		arr.set(0, (long) 1);
		temp = 1;
		/*if (temp != 1 && n == 1) {
			System.out.println(2);
		}*/// else {
			for (long i = 1; i < n; i++) {
				if ((arr.get((int) i) - temp) > 1) {
					arr.set((int) i, arr.get((int) i) - ((arr.get((int) i) - temp) - 1));
					temp = arr.get((int) i);

				} else {
					temp = arr.get((int) i);
				}
			}

			System.out.println(arr.get((int) (n -1)) + 1);
		//}

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Alyona_and_Mex1 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		long[] arr = new long[(int) n];

		for (long i = 0; i < n; i++) {
			arr[(int) i] = sc.nextLong();
		}

		Arrays.sort(arr);
		long temp = arr[0];
		temp = 1;
		/*if (temp != 1 && n == 1) {
			System.out.println(2);
		}*/// else {
			for (long i = 1; i < n; i++) {
				if ((arr[(int) i] - temp) > 1) {
					arr[(int) i] = arr[(int) i] - ((arr[(int) i] - temp) - 1);
					temp = arr[(int) i];

				} else {
					temp = arr[(int) i];
				}
			}

			System.out.println(arr[(int) (n -1)] + 1);
		//}

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.util.Arrays;
import java.util.Scanner;

public class Alyona_and_Mex1 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();

		long[] arr = new long[(int) n];

		for (long i = 0; i < n; i++) {
			arr[(int) i] = sc.nextLong();
		}

		Arrays.sort(arr);
		long temp = arr[0];
		arr[0] = 1;
		temp = 1;
		/*if (temp != 1 && n == 1) {
			System.out.println(2);
		}*/// else {
			for (long i = 1; i < n; i++) {
				if ((arr[(int) i] - temp) > 1) {
					arr[(int) i] = arr[(int) i] - ((arr[(int) i] - temp) - 1);
					temp = arr[(int) i];

				} else {
					temp = arr[(int) i];
				}
			}

			System.out.println(arr[(int) (n -1)] + 1);
		//}

		/*for (long i = 0; i < n; i++) {
			if (arr[(int) i] == 1) {
				continue;
			} else {
				arr[(int) i] = arr[(int) i] - 1;
			}
		}

		long max = (int) arr[0];
		for(long i = 1; i < n; i++) {
			if (max < arr[(int) i]) {
				max = (int) arr[(int) i];
			}
		}
		System.out.println(max + 1);*/

	}

}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class alyonaMex682B {
	public static void main (String[] args) throws Exception {
		long start = System.nanoTime();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	//	File f = new File("mex.txt");
//		FileReader fr = new FileReader(f);
	//	BufferedReader br = new BufferedReader(fr);

		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer (br.readLine());
		int[] arr = new int[n];
		//Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			arr[i]=Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		br.close();
		arr[0]=1;

		for (int i=0;i+1<n;i++) {
			if (arr[i+1]-arr[i]>1) {
				arr[i+1]=arr[i]+1;
			}

		}//end for
		System.out.println(arr[n-1]+1);
		long end = System.nanoTime();
		System.out.println(end-start);
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class alyonaMex682B {
	public static void main (String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer (br.readLine());
		int[] arr = new int[n];
		for(int i=0;i<n;i++) {
			arr[i]=Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		arr[0]=1;
		for (int i=0;i+1<n;i++) {
			if (arr[i+1]-arr[i]>1) {
				arr[i+1]=arr[i]+1;
			}
		}//end for
		System.out.println(arr[n-1]+1);
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class alyonaMex682B {
	public static void main (String[] args) throws Exception {
		//long start = System.nanoTime();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	//	File f = new File("mex.txt");
//		FileReader fr = new FileReader(f);
	//	BufferedReader br = new BufferedReader(fr);

		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer (br.readLine());
		int[] arr = new int[n];
		//Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			arr[i]=Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		br.close();
		arr[0]=1;

		for (int i=0;i+1<n;i++) {
			if (arr[i+1]-arr[i]>1) {
				arr[i+1]=arr[i]+1;
			}

		}//end for
		System.out.println(arr[n-1]+1);
	//	long end = System.nanoTime();
	//	System.out.println(end-start);
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class alyonaMex682B {
	public static void main (String[] args) throws Exception {
		long start = System.nanoTime();
		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		File f = new File("mex.txt");
		FileReader fr = new FileReader(f);
		BufferedReader br = new BufferedReader(fr);

		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer (br.readLine());
		int[] arr = new int[n];
		//Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			arr[i]=Integer.parseInt(st.nextToken());
		}
		Arrays.sort(arr);
		br.close();
		arr[0]=1;

		for (int i=0;i+1<n;i++) {
			if (arr[i+1]-arr[i]>1) {
				arr[i+1]=arr[i]+1;
			}

		}//end for
		System.out.println(arr[n-1]+1);
		long end = System.nanoTime();
		System.out.println(end-start);
	}
}


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class alyonaMex682B {
	public static void main (String[] args) throws Exception {
		//long start = System.nanoTime();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	//	File f = new File("mex.txt");
//		FileReader fr = new FileReader(f);
	//	BufferedReader br = new BufferedReader(fr);

		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer (br.readLine());
		int[] arr = new int[n];
		ArrayList<Integer> al = new ArrayList<>();
		//Integer[] arr = new Integer[n];
		for(int i=0;i<n;i++) {
			//arr[i]=Integer.parseInt(st.nextToken());
			al.add(Integer.parseInt(st.nextToken()));
		}

		Collections.shuffle(al);
		for(int i=0;i<n;i++)
			arr[i]=al.get(i);
		Arrays.sort(arr);
		br.close();
		arr[0]=1;

		for (int i=0;i+1<n;i++) {
			if (arr[i+1]-arr[i]>1) {
				arr[i+1]=arr[i]+1;
			}

		}//end for
		System.out.println(arr[n-1]+1);
	//	long end = System.nanoTime();
	//	System.out.println(end-start);
	}
}


import java.util.*;

public class B682 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

		int m = 100001;
		int[] ar = new int[m];

		for (int i = 0; i < n; i++) {
			ar[scan.nextInt()]++;
		}

		Arrays.sort(ar);

		int max = 0;
		for (int i = 1; i < m; i++) {
			for (int j = 0; j < ar[i]; j++) {
				if (i > max) {
					max++;
				}
			}
		}

		System.out.print(max + 1);
	}
}


import java.util.*;

public class B682 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

		int[] ar = new int[n];

		for (int i = 0; i < n; i++) {
			ar[i] = scan.nextInt();
		}

		Arrays.sort(ar);

		int max = 0;
		for (int i = 0; i < n; i++) {
			int cur = ar[i];
			if (cur > max) {
				max++;
			}
		}

		System.out.print(max + 1);
	}
}


import java.util.*;

public class B682 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

		int m = 100001;
		int[] ar = new int[m];

		for (int i = 0; i < n; i++) {
			int cur = scan.nextInt();
			ar[cur]++;
		}

		int max = 0;
		for (int i = 1; i < m; i++) {
			for (int j = 0; j < ar[i]; j++) {
				if (i > max) {
					max++;
				}
			}
		}

		System.out.print(max + 1);
	}
}


import java.util.*;

public class B682 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();

		int m = 100001;
		int[] ar = new int[m];

		for (int i = 0; i < n; i++) {
			int cur = scan.nextInt();
			ar[Math.min(cur, 100000)]++;
		}

		int max = 0;
		for (int i = 1; i < m; i++) {
			for (int j = 0; j < ar[i]; j++) {
				if (i > max) {
					max++;
				}
			}
		}

		System.out.print(max + 1);
	}
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class R358B  {

    public static void main (String[] args) throws java.lang.Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n = in.nextInt();
        long[] a = in.nextLongArray(n);
        a[0] = 1;
        for (int i = 1; i < n; i++)
            a[i] = Math.min(a[i], a[i - 1] + 1);
        w.println(a[n-1]+1);

        w.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public void skip(int x) {
            while (x-- > 0)
                read();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextString() {
            return next();
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class R358B  {

    public static void main (String[] args) throws java.lang.Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n = in.nextInt();
        long[] a = in.nextLongArray(n);
        Arrays.sort(a);
        a[0] = 1;
        for (int i = 1; i < n; i++)
            a[i] = Math.min(a[i], a[i - 1] + 1);
        //System.out.println("a is : " + Arrays.toString(a));
        w.println(a[n - 1] + 1);

        w.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public void skip(int x) {
            while (x-- > 0)
                read();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextString() {
            return next();
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class R358B  {

    public static void main (String[] args) throws java.lang.Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n = in.nextInt();
        Long[] a = new Long[n];
        for (int i = 0; i < n; i++)
            a[i] = in.nextLong();
        Arrays.sort(a);
        a[0] = 1L;
        for (int i = 1; i < n; i++)
            a[i] = Math.min(a[i], a[i - 1] + 1);
        w.println(a[n - 1] + 1);

        w.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public void skip(int x) {
            while (x-- > 0)
                read();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextString() {
            return next();
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.util.*;
import java.lang.*;
import java.io.*;

public class R358B  {

    public static void main (String[] args) throws java.lang.Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n = in.nextInt();
        ArrayList<Long> a = new ArrayList<>();
        for (int i = 0; i < n; i++)
            a.add(in.nextLong());
        Collections.sort(a);
        a.set(0, 1L);
        for (int i = 1; i < n; i++)
            a.set(i, Math.min(a.get(i), a.get(i - 1) + 1));
        //System.out.println("a is : " + Arrays.toString(a));
        w.println(a.get(n - 1) + 1);

        w.close();
    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }

        public void skip(int x) {
            while (x-- > 0)
                read();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String nextString() {
            return next();
        }

        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }

        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }

        public double nextDouble() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E')
                    return res * Math.pow(10, nextInt());
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E')
                        return res * Math.pow(10, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }
        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] num = new int[n];
            for (int i = 0; i < n; i++)
                num[i] = in.nextInt();
            Arrays.sort(num);
            int ans = 1;
            for (int i = 0; i < n; i++)
                if (ans <= num[i])
                    ans++;
            out.print(ans);
        }

    }
}


/**
 * Created by bubbl on 6/27/2016.
 */
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception{
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        Integer[] nums = new Integer[n];
        for(int i=0;i<n;i++)
            nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int ans=1;
        for(int i=0;i<n;i++)
            if(ans<=nums[i])
                ans++;
        System.out.println(ans);
    }
}

    class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        FastScanner() throws FileNotFoundException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = null;
        }

        String next() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
        }

        int nextInt() throws IOException {
        return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
        return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
        return Double.parseDouble(next());
        }

        String readLine() throws IOException {
        return reader.readLine();
        }
        }


/**
 * Created by bubbl on 6/27/2016.
 */
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception{
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] nums = new int[n];
        for(int i=0;i<n;i++)
            nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int ans=1;
        for(int i=0;i<n;i++)
            if(ans<=nums[i])
                ans++;
        System.out.println(ans);
    }
}

    class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        FastScanner() throws FileNotFoundException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = null;
        }

        String next() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
        }

        int nextInt() throws IOException {
        return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
        return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
        return Double.parseDouble(next());
        }

        String readLine() throws IOException {
        return reader.readLine();
        }
        }


package current;

/**
 * Created by bubbl on 6/27/2016.
 */
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) throws Exception{
        FastScanner sc = new FastScanner();
        int n = sc.nextInt();
        int[] nums = new int[n];
        for(int i=0;i<n;i++)
            nums[i] = sc.nextInt();
        Arrays.sort(nums);
        int ans=1;
        for(int i=0;i<n;i++)
            if(ans<=nums[i])
                ans++;
        System.out.println(ans);
    }
}

    class FastScanner {
        BufferedReader reader;
        StringTokenizer tokenizer;

        FastScanner() throws FileNotFoundException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = null;
        }

        String next() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
        }

        int nextInt() throws IOException {
        return Integer.parseInt(next());
        }

        long nextLong() throws IOException {
        return Long.parseLong(next());
        }

        double nextDouble() throws IOException {
        return Double.parseDouble(next());
        }

        String readLine() throws IOException {
        return reader.readLine();
        }
        }


import java.util.*;
import java.io.*;

/**
  * @author Mighty Cohadar
  */
public class Bravo {

	static void insertionSort(int[] A, int li, int re) {
		for (int r = li + 1; r < re; r++) {
			int val = A[r];
			int l = r;
			while (li < l && A[l-1] > val) {
				A[l] = A[l-1];
				l--;
			}
			A[l] = val;
		}
	}

	static void merge(int[] A, int[] B, int li, int mi, int re) {
		int l = li;
		int r = mi;
		int j = li;
		while (l < mi && r < re) {
			if (A[l] <= A[r]) {
				B[j++] = A[l++];
			} else {
				B[j++] = A[r++];
			}
		}
		while (l < mi) {
			B[j++] = A[l++];
		}
		for (int i = li; i < j; i++) {
			A[i] = B[i];
		}
	}

	static void mergeSort(int[] A, int[] B, int li, int re) {
		if (li >= re) {
			return;
		}
		if (re - li <= 10) {
			insertionSort(A, li, re);
		} else {
			int mi = (li + re) >>> 1;
			mergeSort(A, B, li, mi);
			mergeSort(A, B, mi, re);
			merge(A, B, li, mi, re);
		}
	}

	static void mergeSort(int[] A, int li, int re) {
		mergeSort(A, new int[A.length], li, re);
	}

	public static void main(String[] args) throws Exception {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		int[] A = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = scanner.nextInt();
		}
		mergeSort(A, 0, A.length);
		int j = 1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/* Mighty Cohadar */
public class Bravo {

	public static int mex(int[] A) {
		int j = 1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] >= j) {
				j++;
			}
		}
		return j;
	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[] A = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = scanner.nextInt();
		}
		Arrays.sort(A);
		System.out.println(mex(A));
	}

	static void debug(Object...os) {
		System.err.printf("%.65536s\n", Arrays.deepToString(os));
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/* Mighty Cohadar */
public class Bravo {

	public static void main(String[] args) {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		PriorityQueue<Integer> Q = new PriorityQueue<>();
		for (int i = 0; i < n; i++) {
			Q.add(scanner.nextInt());
		}
		int j = 1;
		for (int a : Q) {
			if (a >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

	static void debug(Object...os) {
		System.err.printf("%.65536s\n", Arrays.deepToString(os));
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/**
  * @author Mighty Cohadar
  */
public class Bravo {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.valueOf(br.readLine());
		List<Integer> L = new ArrayList<>();
		String[] S = br.readLine().split(" ");
		for (int i = 0; i < n; i++) {
			L.add(Integer.valueOf(S[i]));
		}
		Collections.sort(L);
		int j = 1;
		for (int a : L) {
			if (j <= a) {
				j++;
			}
		}
		System.out.println(j);
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/* Mighty Cohadar */
public class Bravo {

	public static int mex(int[] A) {
		int j = 1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] >= j) {
				j++;
			}
		}
		return j;
	}

	public static void main(String[] args) {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		int[] A = new int[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = scanner.nextInt();
		}
		Arrays.sort(A);
		System.out.println(mex(A));
	}

	static void debug(Object...os) {
		System.err.printf("%.65536s\n", Arrays.deepToString(os));
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/**
  * @author Mighty Cohadar
  */
public class Bravo {

	static void swap(long[] A, int i, int j) {
		long t = A[i];
		A[i] = A[j];
		A[j] = t;
	}

	static void insertionSort(long[] A, int li, int re) {
		for (int r = li + 1; r < re; r++) {
			long val = A[r];
			int l = r;
			while (li < l && A[l-1] > A[l]) {
				A[l] = A[l-1];
				l--;
			}
			swap(A, l, r);
		}
	}

	static void merge(long[] A, long[] B, int li, int mi, int re) {
		int l = li;
		int r = mi;
		int j = li;
		while (l < mi && r < re) {
			if (A[l] <= A[r]) {
				B[j++] = A[l++];
			} else {
				B[j++] = A[r++];
			}
		}
		while (l < mi) {
			B[j++] = A[l++];
		}
		for (int i = li; i < j; i++) {
			A[i] = B[i];
		}
	}

	static void mergeSort(long[] A, long[] B, int li, int re) {
		if (li >= re) {
			return;
		}
		if (re - li <= 10) {
			insertionSort(A, li, re);
		} else {
			int mi = (li + re) >>> 1;
			mergeSort(A, B, li, mi);
			mergeSort(A, B, mi, re);
			merge(A, B, li, mi, re);
		}
	}

	static void mergeSort(long[] A, int li, int re) {
		mergeSort(A, new long[A.length], li, re);
	}

	public static void main(String[] args) throws Exception {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = scanner.nextInt();
		}
		mergeSort(A, 0, A.length);
		int j = 1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/**
  * @author Mighty Cohadar
  */
public class Bravo {

	static void swap(long[] A, int i, int j) {
		long t = A[i];
		A[i] = A[j];
		A[j] = t;
	}

	static void insertionSort(long[] A, int li, int re) {
		for (int r = li + 1; r < re; r++) {
			long val = A[r];
			int l = r;
			while (li < l && A[l-1] > A[l]) {
				A[l] = A[l-1];
				l--;
			}
			swap(A, l, r);
		}
	}

	static void merge(long[] A, long[] B, int li, int mi, int re) {
		int l = li;
		int r = mi;
		int j = li;
		while (l < mi && r < re) {
			if (A[l] <= A[r]) {
				B[j++] = A[l++];
			} else {
				B[j++] = A[r++];
			}
		}
		while (l < mi) {
			B[j++] = A[l++];
		}
		for (int i = li; i < j; i++) {
			A[i] = B[i];
		}
	}

	static void mergeSort(long[] A, long[] B, int li, int re) {
		if (li >= re) {
			return;
		}
		if (re - li <= 10) {
			insertionSort(A, li, re);
		} else {
			int mi = (li + re) >>> 1;
			mergeSort(A, B, li, mi);
			mergeSort(A, B, mi, re);
			merge(A, B, li, mi, re);
		}
	}

	static void mergeSort(long[] A, int li, int re) {
		mergeSort(A, new long[A.length], li, re);
	}

	public static void main(String[] args) throws Exception {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		long[] A = new long[n];
		for (int i = 0; i < A.length; i++) {
			A[i] = scanner.nextInt();
		}
		Arrays.sort(A, 0, A.length);
		int j = 1;
		for (int i = 0; i < A.length; i++) {
			if (A[i] >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/* Mighty Cohadar */
public class Bravo {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		PriorityQueue<Integer> Q = new PriorityQueue<>();
		for (int i = 0; i < n; i++) {
			Q.add(scanner.nextInt());
		}
		int j = 1;
		for (int i = 0; i < n; i++) {
			int a = Q.remove();
			if (a >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

	static void debug(Object...os) {
		System.err.printf("%.65536s\n", Arrays.deepToString(os));
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;

/* Mighty Cohadar */
public class Bravo {

	public static void main(String[] args) {
		FastScanner scanner = new FastScanner(System.in);
		int n = scanner.nextInt();
		PriorityQueue<Integer> Q = new PriorityQueue<>();
		for (int i = 0; i < n; i++) {
			Q.add(scanner.nextInt());
		}
		int j = 1;
		for (int i = 0; i < n; i++) {
			int a = Q.remove();
			if (a >= j) {
				j++;
			}
		}
		System.out.println(j);
	}

	static void debug(Object...os) {
		System.err.printf("%.65536s\n", Arrays.deepToString(os));
	}

}

class FastScanner {
	private final BufferedReader in;
	private final StringBuilder sb;
	private StringTokenizer strtok;
	public FastScanner(InputStream is) {
		this.in = new BufferedReader(new InputStreamReader(is));
		this.sb = new StringBuilder();
		this.strtok = null;
	}
	public String next() {
		try {
			if (strtok == null || strtok.hasMoreTokens() == false) {
				strtok = new StringTokenizer(in.readLine());
			}
			return strtok.nextToken();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String nextLine() {
		try {
			if (strtok == null) {
				return in.readLine();
			} else {
				String ret = (strtok.hasMoreTokens()) ? strtok.nextToken("\n") : "";
				strtok = null;
				return ret;
			}
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}
}


import java.util.*;
import java.io.*;
import java.util.Scanner;

/**
 * Created by Hp on 6/18/2016.
 */
public class B {
    public static void main(String [] ar) throws  IOException{

        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bufferedReader.readLine());
        String[] s = bufferedReader.readLine().split(" ");
        List<Integer>a=new ArrayList<Integer>();
        long ans=1;
        for(int i=0;i<n;i++){
            a.add(Integer.parseInt(s[i]));
        }
       Collections.sort(a);
        for(long i:a){
            if(i>=ans){
                ans++;
            }
        }
        System.out.println(ans);
    }

    // -----------MyScanner class for faster input----------
    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
    // --------------------------------------------------------
}