#include <bits/stdc++.h>
using namespace std;
int arr[1000];
int main() {
  int n, cnt = 0, ck = 0, minvalue, minindex;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  for (int i = 0; i < n - 1; i++) {
    ck = 0;
    minindex = i;
    for (int j = i; j < n - 1; j++) {
      if (arr[minindex] > arr[j]) {
        minindex = j;
        ck = 1;
      }
    }
    if (ck == 1) {
      swap(arr[minindex], arr[i]);
      cnt++;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d", arr[i]);
    if (i != n - 1)
      printf(" ");
    else
      printf("\n");
  }
  printf("%d\n", cnt + 1);
  return 0;
}
