#include <bits/stdc++.h>
using namespace std;
int n;
int arr[105];
int dp[105];
int pp[105];
int res = 0;
int ri = -1;
void gob(int p) {
  if (pp[p] >= 0) gob(pp[p]);
  printf("%d ", 2001 + p);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (int)(n); i++) {
    scanf("%d", &arr[i]);
    pp[i] = -1;
  }
  for (int i = 0; i < (int)(n); i++) {
    if (arr[i] == 1)
      dp[i] = 1;
    else {
      for (int j = 0; j < (int)(i); j++)
        if (arr[j] == arr[i] - 1 && dp[j] > 0) {
          dp[i] = dp[j] + 1;
          pp[i] = j;
        }
    }
    if (res < dp[i]) {
      res = dp[i];
      ri = i;
    }
  }
  printf("%d\n", res);
  if (res > 0) gob(ri);
  return 0;
}
