#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1, 0};
int dx[] = {1, -1, 0, 0, 0};
int main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  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; i++) {
    minj = i;
    for (int j = i; j < n; j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (i != minj) cnt++;
    swap(a[i], a[minj]);
  }
  for (int i = 0; i < n; i++) {
    if (i == n)
      cout << a[i];
    else
      cout << a[i] << " ";
  }
  cout << "\n" << cnt;
  return 0;
}
