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