#include <bits/stdc++.h>
using namespace std;
int selectionSort(int A[], int N) {
  int count = 0, j;
  for (int i = 0; i < N; i++) {
    int minj = i;
    for (j = i + 1; j < N; j++) {
      if (A[j] < A[minj]) minj = j;
    }
    swap(A[minj], A[i]);
    count++;
  }
  return count;
}
int main(int argc, const char* argv[]) {
  int A[100], N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  int count = selectionSort(A, N);
  for (int i = 0; i < N; i++) {
    if (i) cout << ' ';
    cout << A[i];
  }
  cout << endl;
  cout << count << endl;
  return 0;
}
