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