import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int num[] = new int[n]; num new int[n] n for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			num[i] = scan.nextInt();
		} {
			num[i] = scan.nextInt();
		} num[i] = scan.nextInt() num[i] num i scan.nextInt() scan.nextInt scan int count = 0; count 0 for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		} {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		} int mini = i; mini i for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			} int j = i; int j = i; j i j < n j n j++ j++ j {
				if (num[j] < num[mini]) {
					mini = j;
				}
			} {
				if (num[j] < num[mini]) {
					mini = j;
				}
			} if (num[j] < num[mini]) {
					mini = j;
				} num[j] < num[mini] num[j] num j num[mini] num mini {
					mini = j;
				} mini = j mini j if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			} mini != i mini i {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			} int tmp = num[i]; tmp num[i] num i num[i] = num[mini] num[i] num i num[mini] num mini num[mini] = tmp num[mini] num mini tmp count++ count for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		} {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		} System.out.print(num[i]) System.out.print System.out System System.out num[i] num i if (i != n - 1)
				System.out.print(" "); i != n - 1 i n - 1 n 1 System.out.print(" ") System.out.print System.out System System.out " " System.out.println() System.out.println System.out System System.out System.out.println(count) System.out.println System.out System System.out count scan.close() scan.close scan String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int num[] = new int[n];

		for (int i = 0; i < n; i++) {
			num[i] = scan.nextInt();
		}

		int count = 0;

		for (int i = 0; i < n; i++) {
			int mini = i;
			for (int j = i; j < n; j++) {
				if (num[j] < num[mini]) {
					mini = j;
				}
			}

			if (mini != i) {
				int tmp = num[i];
				num[i] = num[mini];
				num[mini] = tmp;
				count++;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.print(num[i]);
			if (i != n - 1)
				System.out.print(" ");
		}

		System.out.println();
		System.out.println(count);
		scan.close();
	}

}