#include <bits/stdc++.h>
using namespace std;
int main() {
  int arr[100];
  vector<int> v[100];
  int size;
  cin >> size;
  for (int i = 0; i < size; i++) cin >> arr[i];
  for (int i = 0; i < size; i++) {
    unsigned char temp = i;
    for (int j = i + 1; j < size && arr[i] == 1; j++) {
      if (arr[temp] + 1 == arr[j]) {
        v[i].push_back(j);
        temp = j;
      }
    }
  }
  int max = 0;
  for (int i = 0; i < size; i++)
    if (v[i].size() > max) max = v[i].size();
  bool couted = false;
  for (int i = 0; i < size; i++) {
    if (v[i].size() == max && arr[i] == 1) {
      cout << v[i].size() + 1 << "\n" << i + 2001 << " ";
      for (int j = 0; j < v[i].size(); j++) cout << v[i][j] + 2001 << " ";
      couted = true;
      break;
    }
  }
  if (!couted) cout << "0";
}
