#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n], b[n];
  set<int> order;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    order.insert(a[i]);
  }
  vector<int> vec;
  for (set<int>::iterator i = order.begin(); i != order.end(); i++)
    vec.push_back(*i);
  multiset<pair<int, int> > c[2], d[2];
  for (int i = 0; i < n; i++) {
    b[i] = (int)(lower_bound(vec.begin(), vec.end(), a[i]) - vec.begin());
    d[0].insert(make_pair(-b[i], i + 1));
    d[1].insert(make_pair(b[i], i + 1));
  }
  for (int i = 0; i < n; i++) {
    if (c[0].upper_bound(make_pair(-b[i], 100000000)) != c[0].end() &&
        d[0].upper_bound(make_pair(-b[i], 100000000)) != d[0].end()) {
      printf("3\n%d %d %d\n",
             c[0].upper_bound(make_pair(-b[i], 100000000))->second, i + 1,
             d[0].upper_bound(make_pair(-b[i], 100000000))->second);
      return 0;
    }
    if (c[1].upper_bound(make_pair(b[i], 100000000)) != c[1].end() &&
        d[1].upper_bound(make_pair(b[i], 100000000)) != d[1].end()) {
      printf("3\n%d %d %d\n",
             c[1].upper_bound(make_pair(b[i], 100000000))->second, i + 1,
             d[1].upper_bound(make_pair(b[i], 100000000))->second);
      return 0;
    }
    d[0].erase(d[0].find(make_pair(-b[i], i + 1)));
    d[1].erase(d[1].find(make_pair(b[i], i + 1)));
    c[0].insert(make_pair(-b[i], i + 1));
    c[1].insert(make_pair(b[i], i + 1));
  }
  printf("0\n");
  return 0;
}
