#include <bits/stdc++.h>
using namespace std;
int cnt, minj, A[100];
;
int selectionSort(int N);
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  selectionSort(N);
  for (int i = 0; i < N; i++) {
    cout << A[i] << " ";
  }
  cout << endl << cnt << endl;
}
int selectionSort(int N) {
  for (int i = 0; i < N; i++) {
    minj = i;
    for (int j = i + 1; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    if (i != minj) {
      swap(A[i], A[minj]);
      cnt++;
    }
  }
}
