#include <bits/stdc++.h>
const int maxN = 110;
using namespace std;
int N, V[maxN], D[maxN], rec[maxN];
int afis[maxN];
int main() {
  int i, j;
  scanf("%d", &N);
  for (i = 1; i <= N; i++) scanf("%d", &V[i]);
  for (i = 1; i <= N; i++) {
    if (V[i] == 1) {
      D[i] = 1;
      rec[i] = i;
    }
    for (j = 1; j < i; j++)
      if (V[j] == V[i] - 1 && D[j] + 1 > D[i] && V[i] == D[j] + 1) {
        D[i] = D[j] + 1;
        rec[i] = j;
      }
  }
  int sol = 0;
  for (i = 1; i <= N; i++) sol = max(sol, D[i]);
  printf("%d\n", sol);
  if (sol == 0) return 0;
  for (i = 1; i <= N; i++)
    if (D[i] == sol) break;
  while (i != rec[i]) {
    afis[0]++;
    afis[afis[0]] = i;
    i = rec[i];
  }
  printf("%d ", 2000 + i);
  for (i = afis[0]; i > 0; i--) printf("%d ", 2000 + afis[i]);
  return 0;
}
