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