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