#include <bits/stdc++.h>
using namespace std;
void print(int a[], int N, int b) {
  int i;
  for (i = 0; i < N; i++) {
    if (i < N - 1) cout << a[i] << " ";
    if (i == N - 1) cout << a[i] << endl;
  }
  cout << b << endl;
}
void serection(int a[], int N) {
  int I, i, min, b = 0, p, v, x = 0;
  for (I = 0; I < N; I++) {
    min = a[N - 1];
    p = N - 1;
    for (i = N - 1; i >= 0 + x; i--) {
      if (min > a[i]) {
        min = a[i];
        p = i;
      }
    }
    x++;
    v = a[I];
    a[I] = min;
    a[p] = v;
    b++;
  }
  print(a, N, b);
}
int main() {
  int N, i;
  int a[100];
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> a[i];
  }
  serection(a, N);
  return 0;
}
