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