#include <bits/stdc++.h>
int main() {
  int n, a[100], i, j, minj, tmp, count = 0, k = 1;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (i = 0; i < n; i++) {
    minj = i;
    for (j = i; j < n; j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (k = minj) {
      k = 0;
      tmp = a[j];
      a[j] = a[minj];
      a[minj] = a[j];
      count++;
    }
  }
  for (i = 0; i < n - 1; i++) {
    printf("%d ", a[i]);
  }
  printf("%d\n", a[n - 1]);
  printf("%d\n", count);
  return 0;
}
