#include <bits/stdc++.h>
using namespace std;
int A[100], N, times = 0;
void selectionSort(int A[], int N);
void print(int A[], int N);
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> A[i];
  selectionSort(A, N);
  print(A, N);
}
void selectionSort(int A[], int N) {
  int temp = 0;
  int minj;
  for (int i = 0; i < N; i++) {
    minj = i;
    for (int j = i; j < N; j++) {
      if (A[j] < A[minj]) minj = j;
    }
    temp = A[i];
    A[i] = A[minj];
    A[minj] = temp;
    if (minj != i) times++;
  }
}
void print(int A[], int N) {
  for (int i = 0; i < N; i++) {
    cout << A[i];
    if (i != N - 1) cout << " ";
  }
  cout << endl << times;
}
