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