#include <bits/stdc++.h>
int main(void) {
  unsigned char aubW_Dtestcase[100];
  unsigned char ubW_Dtc_cnt;
  unsigned char ubW_Dtc_min;
  unsigned char ubW_Dtrade;
  unsigned char ubW_Carray_cnt;
  unsigned char ubW_Carray_sub_cnt;
  unsigned short usW_Csort_cnt;
  scanf("%d", &ubW_Dtc_cnt);
  for (ubW_Carray_cnt = 0; ubW_Carray_cnt < ubW_Dtc_cnt; ubW_Carray_cnt++) {
    scanf("%d", &aubW_Dtestcase[ubW_Carray_cnt]);
  }
  for (ubW_Carray_cnt = 0; ubW_Carray_cnt < ubW_Dtc_cnt; ubW_Carray_cnt++) {
    ubW_Dtc_min = ubW_Carray_cnt;
    for (ubW_Carray_sub_cnt = ubW_Carray_cnt; ubW_Carray_sub_cnt < ubW_Dtc_cnt;
         ubW_Carray_sub_cnt++) {
      if (aubW_Dtestcase[ubW_Carray_sub_cnt] < aubW_Dtestcase[ubW_Dtc_min]) {
        ubW_Dtc_min = ubW_Carray_cnt;
        ubW_Dtrade = aubW_Dtestcase[ubW_Carray_sub_cnt];
        aubW_Dtestcase[ubW_Carray_sub_cnt] = aubW_Dtestcase[ubW_Dtc_min];
        aubW_Dtestcase[ubW_Dtc_min] = ubW_Dtrade;
        usW_Csort_cnt++;
      }
    }
  }
  for (ubW_Carray_cnt = 0; ubW_Carray_cnt < ubW_Dtc_cnt - 1; ubW_Carray_cnt++) {
    printf("%d ", aubW_Dtestcase[ubW_Carray_cnt]);
  }
  printf("%d\n", aubW_Dtestcase[ubW_Dtc_cnt - 1]);
  printf("%d\n", usW_Csort_cnt);
  return 0;
}
