#include <bits/stdc++.h>
using namespace std;
int a[109];
int main() {
  int n, x = 0, c, b;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i < n; i++) {
    int min = a[i];
    for (int j = i; j < n; j++) {
      if (a[j] < min) {
        min = a[j];
        b = j;
      }
    }
    if (min != a[i]) {
      c = a[i];
      a[i] = a[b];
      a[b] = c;
      x++;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n%d", x);
  return 0;
}
