#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long N = 1000 + 5;
vector<long long> adj[N];
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long t;
  t = 1;
  for (long long tc = 0; tc < t; tc++) {
    long long n;
    cin >> n;
    vector<long long> arr(n), v;
    for (long long i1 = 0; i1 < n; i1++) {
      cin >> arr[i1];
      if (arr[i1] >= 1) adj[arr[i1]].push_back(i1);
    }
    long long indx = -1;
    for (long long x = 1; x <= n; x++) {
      sort(adj[x].begin(), adj[x].end());
      for (auto w : adj[x]) {
        if (w > indx && v.size() == x - 1) {
          v.push_back(w);
          indx = w;
          break;
        }
      }
    }
    cout << v.size() << "\n";
    for (long long i = 0; i < v.size(); i++) cout << (v[i] + 2000 + 1) << " ";
    cout << "\n";
  }
  return 0;
}
