#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 667;
int a[N];
vector<int> p;
vector<int> an[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == 1) p.push_back(i);
  }
  int mx = -1, r = 0;
  for (auto j : p) {
    int cur = 1, ans = 0;
    for (int i = j; i < n; ++i) {
      if (a[i] == cur) {
        ans++;
        cur++;
        an[j].push_back(2001 + i);
      }
    }
    if (ans > mx) {
      r = j;
      mx = ans;
    }
  }
  cout << (int)(an[r].size()) << '\n';
  for (auto i : an[r]) {
    cout << i << ' ';
  }
  return 0;
}
