public void solve() throws IOException {
    int n = nextInt();
    int[] heights = new int[n];
    for (int x = 0; x < n; x++) {
      heights[x] = nextInt();
    }
    Arrays.sort(heights);
    int min = n;
    for (int x = n; x >= 0; x--) {
      int charges = n - x;
      if (x > 0)
        charges += heights[x - 1];
      if (charges < min) {
        min = charges;
      }
    }
    System.out.println(min);
  }