#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  int line[100];
  for (int i = 0; i < num; ++i) {
    cin >> line[i];
  }
  int answer = 0;
  int place;
  for (int i = 0; i < num - 1; ++i) {
    place = i;
    for (int ii = num - 1; ii > i; --ii) {
      if (line[place] > line[ii]) {
        place = ii;
      }
    }
    if (i != place) {
      int doll;
      doll = line[i];
      line[i] = line[place];
      line[place] = doll;
      ++answer;
    }
  }
  for (int i = 0;; ++i) {
    cout << line[i];
    if (i == num - 1) break;
    cout << " ";
  }
  cout << endl;
  cout << answer << endl;
  cin >> answer;
  return 0;
}
