#include <bits/stdc++.h>
using namespace std;
int n, x[105], l[105];
int main() {
  cin >> n;
  int i, j;
  for (i = 1; i <= n; ++i) cin >> x[i];
  for (i = 1; i <= n && x[i] != 1; ++i)
    ;
  l[i] = 1;
  int max;
  for (++i; i <= n; ++i) {
    max = 0;
    if (x[i] > 1) {
      for (j = 1; j <= i - 1; ++j)
        if (l[j] > max && x[i] == x[j] + 1) max = l[j];
      if (max) l[i] = max + 1;
    }
    if (x[i] == 1) l[i] = 1;
  }
  int p = 0;
  max = 0;
  for (i = 1; i <= n; ++i)
    if (l[i] > max) p = i, max = l[i];
  int nr = 0;
  if (p == 0)
    cout << 0 << '\n';
  else {
    x[++nr] = p + 2000;
    for (i = p - 1; i; --i)
      if (l[p] == l[i] + 1 && l[i]) x[++nr] = i + 2000, p = i;
    cout << nr << '\n';
    for (i = nr; i; --i) cout << x[i] << " ";
    cout << '\n';
  }
  return 0;
}
