import java.util.Scanner;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;

public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
} import java.util.Scanner; Scanner java.util import java.lang.Integer; Integer java.lang import java.lang.StringBuilder; StringBuilder java.lang import java.lang.Math; Math java.lang public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
} Main private static int N; N private static int[] a; a private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  } print {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  } StringBuilder result = new StringBuilder(); result new StringBuilder() for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      result.append(a[i]);
      result.append(" ");
    } {
      result.append(a[i]);
      result.append(" ");
    } result.append(a[i]) result.append result a[i] a i result.append(" ") result.append result " " System.out.println(result.toString().trim()) System.out.println System.out System System.out result.toString().trim() result.toString().trim result.toString() result.toString result private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  } sort {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  } int swapped = 0; swapped 0 if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    } N == 1 N 1 {
      print();
      System.out.println(swapped);
      return;
    } print() print System.out.println(swapped) System.out.println System.out System System.out swapped return; for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    } {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    } int minIndex = i; minIndex i for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      } int j = i; int j = i; j i j < N j N j++ j++ j {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      } {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      } if (a[j] < a[minIndex]) {
          minIndex = j;
        } a[j] < a[minIndex] a[j] a j a[minIndex] a minIndex {
          minIndex = j;
        } minIndex = j minIndex j if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      } minIndex != i minIndex i {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      } int tmp = a[minIndex]; tmp a[minIndex] a minIndex a[minIndex] = a[i] a[minIndex] a minIndex a[i] a i a[i] = tmp a[i] a i tmp swapped++ swapped print() print System.out.println(swapped) System.out.println System.out System System.out swapped public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  } main {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  } Scanner in = new Scanner(System.in); in new Scanner(System.in) N = in.nextInt() N in.nextInt() in.nextInt in a = new int[N] a new int[N] N for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      a[i] = in.nextInt();
    } {
      a[i] = in.nextInt();
    } a[i] = in.nextInt() a[i] a i in.nextInt() in.nextInt in sort() sort String[] args args public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
} public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
} Main
import java.util.Scanner;
import java.lang.Integer;
import java.lang.StringBuilder;
import java.lang.Math;

public class Main {
  private static int N;
  private static int[] a;

  private static void print() {
    StringBuilder result = new StringBuilder();
    for (int i = 0; i < N; i++) {
      result.append(a[i]);
      result.append(" ");
    }
    System.out.println(result.toString().trim());
  }

  private static void sort() {
    int swapped = 0;
    if (N == 1) {
      print();
      System.out.println(swapped);
      return;
    }

    for (int i = 0; i < N; i++) {
      int minIndex = i;
      for (int j = i; j < N; j++) {
        if (a[j] < a[minIndex]) {
          minIndex = j;
        }
      }
      // swap
      if (minIndex != i) {
        int tmp = a[minIndex];
        a[minIndex] = a[i];
        a[i] = tmp;
        swapped++;
      }
    }
    print();
    System.out.println(swapped);
  }

  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    N = in.nextInt();
    a = new int[N];
    for (int i = 0; i < N; i++) {
      a[i] = in.nextInt();
    }

    // sort a.
    sort();
    // a is now sorted.


  }
}