#include <bits/stdc++.h>
unsigned short selectionSort(std::vector<unsigned short> &Numbers) {
  const size_t n = Numbers.size();
  unsigned short minj;
  unsigned short SwapCount = 0;
  for (size_t i = 0; i < n; i++) {
    minj = i;
    for (size_t j = i; j < n; j++) {
      if (Numbers[j] < Numbers[minj]) {
        minj = j;
      }
    }
    if (i != minj) {
      SwapCount++;
    }
    std::swap(Numbers[i], Numbers[minj]);
  }
  return SwapCount;
}
void printVector(const std::vector<unsigned short> &v) {
  std::ostringstream oss;
  std::copy(v.begin(), v.end() - 1,
            std::ostream_iterator<unsigned short>(oss, " "));
  oss << v.back();
  std::cout << oss.str() << std::endl;
}
int main(int argc, char const *argv[]) {
  unsigned int N;
  std::istringstream iss;
  std::string Param;
  while (true) {
    getline(std::cin, Param);
    iss.str(Param);
    iss >> N;
    iss.clear();
    if (N < 1 || N > 100) {
      std::cout << "Error: 1 <= N <= 100" << std::endl;
    } else {
      break;
    }
  }
  size_t i = 0;
  std::vector<unsigned short> A(N, 0);
  while (true) {
    bool isValid = false;
    unsigned short An;
    getline(std::cin, Param);
    iss.str(Param);
    while (i < N) {
      iss >> An;
      if (An > 100) {
        std::cout << "Error: 0 <= A <= 100" << std::endl;
        isValid = false;
        break;
      } else {
        A[i] = An;
        isValid = true;
        i++;
      }
    }
    iss.clear();
    if (isValid == true) {
      break;
    }
  }
  unsigned short SwapCount = selectionSort(A);
  printVector(A);
  std::cout << SwapCount << std::endl;
  return 0;
}
