#include <bits/stdc++.h>
void change(int a, int b) {
  int temp;
  temp = a;
  a = b;
  b = temp;
}
int minsarch(int a[], int c, int b) {
  int min = a[c];
  for (int i = c; i < b; i++) {
    if (min > a[i]) {
      min = a[i];
    }
  }
  return min;
}
int main() {
  int a, i;
  int min;
  int r[100], ans[100];
  int num = 0;
  scanf("%d", &a);
  for (i = 0; i < a; i++) {
    scanf("%d", &r[i]);
  }
  for (i = 0; i < a; i++) {
    min = minsarch(r, i, a);
    if (min < r[i]) {
      change(min, r[i]);
      num++;
    }
    ans[i] = r[i];
  }
  if (a > 1) {
    for (i = 0; i < a - 1; i++) {
      printf("%d ", ans[i]);
    }
  }
  printf("%d\n%d\n", ans[a - 1], num);
  return 0;
}
