#include <bits/stdc++.h>
using namespace std;
int N;
int s[105];
int sol[105];
int tmp[105];
int main() {
  int i;
  cin >> N;
  for (i = 1; i <= N; i++) {
    cin >> s[i];
  }
  int ans = 0;
  int curr;
  for (i = 1; i <= N; i++) {
    if (s[i] == 1) {
      curr = 2;
      tmp[0] = i;
      for (int j = i + 1; j <= N; j++) {
        if (s[j] == curr) {
          tmp[curr - 1] = j;
          curr++;
        }
      }
      curr--;
      if (curr > ans) {
        memcpy(sol, tmp, sizeof(tmp));
        ans = curr;
      }
    }
  }
  cout << ans << endl;
  if (ans > 0) {
    for (i = 0; i < ans; i++) {
      cout << 2000 + sol[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
