#include <bits/stdc++.h>
using namespace std;
static const int N = 100;
void inputArray(int a[], int n) {
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
}
void swap(int a, int b) {
  int v;
  v = a;
  a = b;
  b = v;
}
void printArray(int a[], int n) {
  int k = 0;
  while (1) {
    if (k == n - 1)
      break;
    else {
      printf("%d ", a[k]);
    }
    k++;
  }
  printf("%d\n", a[n - 1]);
}
int selectionSort(int a[], int n) {
  int minj, count = 0;
  for (int i = 0; i < n - 1; ++i) {
    minj = i;
    for (int j = i; j < n - 1; ++i) {
      if (a[j] < a[minj]) {
        minj = j;
      }
    }
    if (i != minj) {
      swap(a[i], a[minj]);
      count++;
    }
  }
  return count;
}
int main(int argc, char const *argv[]) {
  int A[N];
  int n, m;
  cin >> n;
  inputArray(A, n);
  m = selectionSort(A, n);
  printArray(A, n);
  cout << m << endl;
  return 0;
}
