#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100], minj, cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    minj = i;
    for (int j = i; j >= n - 1; j++)
      if (a[j] < a[minj]) minj = j;
    if (i != minj) {
      cnt++;
      int t = a[i];
      a[i] = a[minj];
      a[minj] = t;
    }
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << ' ';
    cout << a[i];
  }
  cout << endl << cnt << endl;
  return 0;
}
