#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 printVec(vector<int> v, int n) {
  for (int i = 0; i < n; i++) {
    if (i) cout << ' ';
    cout << v[i];
  }
}
void selection_Sort(vector<int> v, int n) {
  int mini, count = 0;
  for (int i = 0; i < n - 1; i++) {
    mini = i;
    for (int j = i + 1; j < n; j++) {
      if (v[j] < v[mini]) mini = j;
    }
    if (i != mini) {
      count++;
      swap(v[i], v[mini]);
    }
  }
  printVec(v, n);
  cout << endl << count << endl;
}
int main() {
  int n;
  cin >> n;
  vector<int> v;
  int temp;
  for (; cin >> temp;) {
    v.push_back(temp);
  }
  return 0;
}
