#include <bits/stdc++.h>
int main() {
  int n, wk, i, flg, j;
  int minj;
  int data[102];
  int chg_cnt;
  char buff[8192];
  char *ptr, *wk_p;
  gets(buff);
  sscanf(buff, "%d", &n);
  gets(buff);
  ptr = strtok(buff, " ");
  for (i = 0; i < n; i++) {
    sscanf(ptr, "%d");
    ptr = strtok(NULL, " ");
  }
  for (chg_cnt = 0, i = 0; i < n; i++) {
    minj = i;
    for (flg = 0, j = i + 1; j < n; j++) {
      if (data[j] < data[minj]) {
        minj = j;
        flg++;
      }
    }
    if (flg != 0) {
      chg_cnt++;
      wk = data[minj];
      data[minj] = data[i];
      data[i] = wk;
    }
  }
  for (i = 0; i < n; i++) {
    if (i == n - 1) {
      printf("%d", data[i]);
    } else {
      printf("%d ", data[i]);
    }
  }
  printf("\n");
  printf("%d\n", chg_cnt);
  return 0;
}
