#include <bits/stdc++.h>
using namespace std;
int a[3300], to, x[3300], y[3300];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < n; i++) {
    int Min = i;
    for (int j = i + 1; j < n; j++)
      if (a[Min] > a[j]) Min = j;
    if (Min == i) continue;
    x[to] = i;
    y[to++] = Min;
    swap(a[Min], a[i]);
  }
  cout << to << endl;
  for (int i = 0; i < to; i++) printf("%d %d\n", x[i], y[i]);
  return 0;
}
