#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> str;
  str.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  int cnter = 0;
  for (int i = 0; i <= (n - 1); i++) {
    int minj = i;
    for (int j = i; j <= (n - 1); j++) {
      if (str[j] <= str[minj]) {
        minj = j;
      }
    }
    int temp = str[i];
    str[i] = str[minj];
    str[minj] = temp;
    cnter++;
  }
  return cnter;
  for (int i = 0; i < n; i++) {
    cout << str[i];
    if (i != (n - 1)) {
      cout << " ";
    }
  }
  cout << endl;
  cout << cnter << endl;
  return 0;
}
