#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n;
int a[110];
void print(void) {
  for (int i = 0; i < n; i++) {
    if (i > 0) cout << " ";
    cout << a[i];
  }
  cout << endl;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int minj = i;
    for (int j = i; j < n; j++) {
      if (a[minj] > a[j]) {
        minj = j;
      }
    }
    if (minj != i) {
      int v = a[i];
      a[i] = a[minj];
      a[minj] = a[i];
      ans++;
    }
  }
  print();
  cout << ans << endl;
  return 0;
}
