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