#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int n, a[101010];
int main() {
  cin >> n;
  for (int i = (0); i < (n); i++) cin >> a[i];
  int cnt = 0;
  for (int i = (0); i < (n); i++) {
    int minj = i;
    for (int j = i; j < n; j++) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    swap(a[i], a[minj]);
    cnt++;
  }
  for (int i = (0); i < (n); i++) cout << a[i] << (i != n - 1 ? " " : "\n");
  cout << cnt << endl;
}
