#include <bits/stdc++.h>
void swap(int *a, int *b) {
  int t = *b;
  *b = *a;
  *a = t;
}
int selectionSort(int *A, int N) {
  int cnt = 1;
  for (int i = (0); i < (N - 1); ++i) {
    int minj = i;
    for (int j = (i); j < (N - 1); ++j) {
      if (A[j] < A[minj]) minj = j;
    }
    if (A[i] != A[minj]) cnt++;
    swap(&A[i], &A[minj]);
  }
  return cnt;
}
int N;
int A[10000];
void solver() {
  scanf("%d", &N);
  for (int i = (0); i < (N); ++i) scanf("%d", &A[i]);
  int ans = selectionSort(A, N);
  for (int i = (0); i < (N - 1); ++i) printf("%d ", A[i]);
  printf("%d\n", A[N - 1]);
  printf("%d\n", ans);
}
int main() {
  solver();
  return 0;
}
