#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, tmp, min, index, count = 0;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; ++i) {
    index = i;
    min = 101;
    for (int j = i; j < n; ++j) {
      if (a[j] < min) {
        min = a[j];
        index = j;
      }
    }
    tmp = a[i];
    a[i] = min;
    a[index] = tmp;
    count++;
  }
  for (int i = 0; i < n; ++i) {
    cout << a[i] << ((i == n - 1) ? '\n' : ' ');
  }
  cout << count << '\n';
}
