#include <bits/stdc++.h>
static unsigned char SelectionSort_U08(unsigned char *u08p_input_data,
                                       unsigned char u08_data_num);
static void SwapNum_Void(unsigned char *u08p_x, unsigned char *u08p_y);
int main(void) {
  unsigned char u08_data_num = (unsigned char)0;
  unsigned char *u08p_input_data;
  unsigned char u08_change_count = (unsigned char)0;
  unsigned char u08_i = (unsigned char)0;
  unsigned char u08_return_val = (unsigned char)0;
  scanf("%d", &u08_data_num);
  if ((u08_data_num < (unsigned char)1) ||
      ((unsigned char)100 < u08_data_num)) {
    u08_return_val = (unsigned char)1;
  } else {
    u08p_input_data =
        (unsigned char *)calloc(u08_data_num, sizeof(unsigned char));
    if (NULL == u08p_input_data) {
      u08_return_val = (unsigned char)1;
    } else {
      for (u08_i = (unsigned char)0; u08_i < u08_data_num; u08_i++) {
        scanf("%d", &u08p_input_data[u08_i]);
        if ((u08p_input_data[u08_i] < (unsigned char)0) ||
            ((unsigned char)100 < u08p_input_data[u08_i])) {
          free(u08p_input_data);
          u08_return_val = (unsigned char)1;
          break;
        } else {
        }
      }
      if (0 == u08_return_val) {
        u08_change_count = SelectionSort_U08(&u08p_input_data[0], u08_data_num);
        for (u08_i = (unsigned char)0; u08_i < u08_data_num; u08_i++) {
          if (u08_i < u08_data_num - 1) {
            printf("%d ", u08p_input_data[u08_i]);
          } else {
            printf("%d\n", u08p_input_data[u08_i]);
          }
        }
        printf("%d\n", u08_change_count);
        free(u08p_input_data);
      } else {
      }
    }
  }
  return u08_return_val;
}
static unsigned char SelectionSort_U08(unsigned char *u08p_input_data,
                                       unsigned char u08_data_num) {
  unsigned char u08_change_count = (unsigned char)0;
  unsigned char u08_min_idx = (unsigned char)0;
  unsigned char u08_i = (unsigned char)0;
  unsigned char u08_j = (unsigned char)0;
  for (u08_i = (unsigned char)0; u08_i < u08_data_num; u08_i++) {
    u08_min_idx = u08_i;
    for (u08_j = u08_i; u08_j < u08_data_num; u08_j++) {
      if (u08p_input_data[u08_j] < u08p_input_data[u08_min_idx]) {
        u08_min_idx = u08_j;
      } else {
      }
    }
    if (u08_min_idx != u08_i) {
      SwapNum_Void(&u08p_input_data[u08_min_idx], &u08p_input_data[u08_i]);
      u08_change_count++;
    } else {
    }
  }
  return u08_change_count;
}
static void SwapNum_Void(unsigned char *u08p_x, unsigned char *u08p_y) {
  unsigned char u08_tmp = 0;
  u08_tmp = *u08p_x;
  *u08p_x = *u08p_y;
  *u08p_y = u08_tmp;
}
