#include <bits/stdc++.h>
using namespace std;
void SelectionSort(int N, vector<int> list) {
  int min, v, count = 0;
  for (int i = 0; i < N - 1; i++) {
    min = i;
    for (int j = i + 1; j < N; j++) {
      if (list[min] > list[j]) {
        min = j;
      }
    }
    if (min != i) {
      v = list[min];
      list[min] = list[i];
      list[i] = v;
      count++;
    }
  }
  for (int j = 0; j < N; j++) {
    cout << list[j] << " ";
  }
  cout << endl;
  cout << count << endl;
}
int main() {
  int N, Num;
  cin >> N;
  vector<int> Sort(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> Num;
    Sort[i] = Num;
  }
  SelectionSort(N, Sort);
  return 0;
}
