#include <bits/stdc++.h>
using namespace std;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);
void print(vector<int> v) {
  int n = v.size();
  for (int i = 0; i < n; i++) {
    if (i) cout << ' ';
    cout << v[i];
  }
  cout << endl;
}
int selection_Sort(int a[], int n) {
  int sw = 0;
  int min_j = 0;
  int t = 0;
  for (int i = 0; i < n - 1; i++) {
    min_j = i;
    for (int j = 0; j < n; j++) {
      if (a[j] < a[min_j]) min_j = j;
    }
    t = a[i];
    a[i] = a[min_j];
    a[min_j] = t;
    if (i != min_j) sw++;
  }
  return sw;
}
signed main() {
  int n;
  cin >> n;
  int a[100];
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  int sw = selection_Sort(a, n);
  for (int i = (0); i < (n); ++i) {
    if (i > 0) cout << " ";
    cout << a[i];
  }
  cout << "\n" << sw << endl;
}
