#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
int dp[N], nxt[N];
int n, ar[N];
int rec(int x) {
  int &ret = dp[x];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = x + 1; i < n; ++i)
    if (ar[i] == ar[x] + 1 && 1 + rec(i) > ret) {
      ret = 1 + rec(i);
      nxt[x] = i;
    }
  return ret;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, -1, sizeof(dp));
  memset(nxt, -1, sizeof(nxt));
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> ar[i];
  int ans = 0, bi;
  for (int i = 0; i < n; ++i)
    if (ar[i] == 1 && ans < rec(i) + 1) {
      ans = rec(i) + 1;
      bi = i;
    }
  cout << ans << endl;
  if (ans == 0) return 0;
  do {
    cout << 2001 + bi << " ";
    bi = nxt[bi];
  } while (bi != -1);
  return 0;
}
