#include <bits/stdc++.h>
using namespace std;
int main() {
  double M[10000];
  int n, b, a, k = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> M[i];
  }
  for (int i = 1; i <= n; i++) {
    a = i;
    for (int j = i + 1; j <= n; j++)
      if (M[j] < M[a]) a = j;
    if (a != i) {
      swap(M[i], M[a]);
      k++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      cout << M[i];
    } else
      cout << " " << M[i];
  }
  cout << endl << k;
  return 0;
}
