#include <bits/stdc++.h>
using namespace std;
int selectionSort(int A[], int N) {
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    int minj = i;
    for (int j = i; i < N; j++) {
      if (A[j] < A[minj]) minj = j;
    }
    int tmp = A[i];
    A[i] = A[minj];
    A[minj] = tmp;
    if (i != minj) cnt++;
  }
  return cnt;
}
int main(void) {
  ios::sync_with_stdio(false);
  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;
  return 0;
}
