#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector <int> a(n);
    vector <int> a2(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        a2[i] = a[i];
    }
    sort(a.begin(), a.end());
    vector <int> t;
    for (int i = 0; i < n; i++)
        if (a[i] != a2[i])
            t.push_back(i);
    if (t.size() == 2)
    {
        cout << 1 << endl;
        cout << t[0] +1 << " " << t[1] +1;
    }
    if (t.size() == 0)
    {
        cout << 0;
    }
}