#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int i, j, k, temp, count, minj;
  for (long long int k = (long long int)(0); k < (long long int)(n); k++) {
    cin >> a[k];
  }
  count = 0;
  for (long long int i = (long long int)(0); i < (long long int)(n); i++) {
    minj = i;
    for (long long int j = (long long int)(1); j < (long long int)(n); j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (i != minj) {
      temp = a[i];
      a[i] = a[minj];
      a[minj] = temp;
      count++;
    }
  }
  cout << a[0];
  for (long long int k = (long long int)(1); k < (long long int)(n); k++) {
    cout << " " << a[k];
  }
  cout << endl << count << endl;
  return 0;
}
