import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
} import java.io.*; io.* java public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
} Main public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  } main {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  } try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {} catch (IOException e) {} IOException e {} {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) int count = Integer.parseInt(in.readLine()); count Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in int[] iArr = new int[count]; iArr new int[count] count String[] sArr = in.readLine().split(" "); sArr in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      } int i=0; int i=0; i 0 i<sArr.length i sArr.length sArr sArr.length i++ i++ i {
        iArr[i] = Integer.parseInt(sArr[i]);
      } {
        iArr[i] = Integer.parseInt(sArr[i]);
      } iArr[i] = Integer.parseInt(sArr[i]) iArr[i] iArr i Integer.parseInt(sArr[i]) Integer.parseInt Integer sArr[i] sArr i int swapCount = 0; swapCount 0 for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      } int i = 0; int i = 0; i 0 i < iArr.length i iArr.length iArr iArr.length i++ i++ i {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      } {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      } int minj = i; minj i for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        } int j = i; int j = i; j i j < iArr.length j iArr.length iArr iArr.length j++ j++ j {
          if(iArr[j] < iArr[minj]) { minj = j; }
        } {
          if(iArr[j] < iArr[minj]) { minj = j; }
        } if(iArr[j] < iArr[minj]) { minj = j; } iArr[j] < iArr[minj] iArr[j] iArr j iArr[minj] iArr minj { minj = j; } minj = j minj j if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        } minj != i minj i {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        } int tmp = iArr[minj]; tmp iArr[minj] iArr minj iArr[minj] = iArr[i] iArr[minj] iArr minj iArr[i] iArr i iArr[i] = tmp iArr[i] iArr i tmp swapCount++ swapCount StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i : iArr){
        sb.append(i).append(" ");
      } int i iArr {
        sb.append(i).append(" ");
      } {
        sb.append(i).append(" ");
      } sb.append(i).append(" ") sb.append(i).append sb.append(i) sb.append sb i " " System.out.println(sb.toString().trim()) System.out.println System.out System System.out sb.toString().trim() sb.toString().trim sb.toString() sb.toString sb System.out.println(swapCount) System.out.println System.out System System.out swapCount String[] args args public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
} public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
} Main
import java.io.*;

public class Main {
  public static void main(String[] args) {
    try {
      BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
      int count = Integer.parseInt(in.readLine());
      int[] iArr = new int[count];
      String[] sArr = in.readLine().split(" ");
      for(int i=0; i<sArr.length; i++) {
        iArr[i] = Integer.parseInt(sArr[i]);
      }
      int swapCount = 0;
      for(int i = 0; i < iArr.length; i++) {
        int minj = i;
        for(int j = i; j < iArr.length; j++) {
          if(iArr[j] < iArr[minj]) { minj = j; }
        }
        if(minj != i) {
          int tmp = iArr[minj];
          iArr[minj] = iArr[i];
          iArr[i] = tmp;
          swapCount++;
        }
      }
      StringBuilder sb = new StringBuilder();
      for(int i : iArr){
        sb.append(i).append(" ");
      }
      System.out.println(sb.toString().trim());
      System.out.println(swapCount);
    } catch (IOException e) {}
  }
}