#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> br, dp, dos;
int main() {
  scanf("%d", &n);
  br.resize(n);
  dp.resize(n, 0);
  dos.resize(n, -1);
  int i, j, sol = 0, solind = -1;
  for (i = 0; i < n; ++i) {
    scanf("%d", &br[i]);
    if (br[i] == 1) dp[i] = 1;
  }
  for (i = 1; i < n; ++i) {
    if (br[i] <= 1) continue;
    for (j = 0; j < i; ++j) {
      if (br[j] + 1 == br[i] && dp[j]) {
        if (br[i] == br[j] + 1) {
          dp[i] = dp[j] + 1;
          dos[i] = j;
        }
      }
    }
  }
  for (i = 0; i < n; ++i)
    if (dp[i] > sol) {
      sol = dp[i];
      solind = i;
    }
  printf("%d\n", sol);
  if (sol) {
    stack<int> isp;
    while (solind != -1) {
      isp.push(2000 + solind + 1);
      solind = dos[solind];
    }
    while (!isp.empty()) {
      printf("%d ", isp.top());
      isp.pop();
    }
    printf("\n");
  }
  cin.get();
  cin.get();
  return 0;
}
