#include <bits/stdc++.h>
using namespace std;
const int INF = 99999999;
const double PI = 3.1415926535897932384626;
const double EPS = 1E-11;
int a[110], p[110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  memset(p, -1, sizeof(p));
  p[0] = -2;
  for (int i = 0; i < n; i++) {
    if (a[i] > 0 && p[a[i] - 1] != -1 && p[a[i]] == -1) {
      p[a[i]] = i;
    }
  }
  for (int i = 109; i > 0; i--) {
    if (p[i] != -1) {
      vector<int> v;
      int t = p[i];
      while (t != -2) {
        v.push_back(t);
        t = p[a[t] - 1];
      }
      printf("%d\n", v.size());
      for (int i = (int)v.size() - 1; i >= 0; i--) printf("%d ", 2001 + v[i]);
      return 0;
    }
  }
  printf("0\n");
}
