K = int(input()) weights = list(map(int, input().split())) result = 1 weights.sort() for w in weights: if result < w: break result += w print(result)