import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.FileReader; FileReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util public class Main {
	public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	}
} Main public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	} main {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	} List<Integer> A = new ArrayList<Integer>(); A new ArrayList<Integer>() BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] s_in = br.readLine().split(" "); s_in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (String s : s_in)
			A.add(Integer.parseInt(s)); String s s_in A.add(Integer.parseInt(s)); A.add(Integer.parseInt(s)) A.add A Integer.parseInt(s) Integer.parseInt Integer s int cnt_swap = 0; cnt_swap 0 for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		} {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		} int mini = i; mini i for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j; int j = i + 1; int j = i + 1; j i + 1 i 1 j < N j N j++ j++ j if (A.get(j) < A.get(mini))
					mini = j; if (A.get(j) < A.get(mini))
					mini = j; A.get(j) < A.get(mini) A.get(j) A.get A j A.get(mini) A.get A mini mini = j mini j if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			} mini != i mini i {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			} int tmp = A.get(i); tmp A.get(i) A.get A i A.set(i, A.get(mini)) A.set A i A.get(mini) A.get A mini A.set(mini, tmp) A.set A mini tmp cnt_swap++ cnt_swap StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (int n : A) {
			sb.append(n);
			sb.append(' ');
		} int n A {
			sb.append(n);
			sb.append(' ');
		} {
			sb.append(n);
			sb.append(' ');
		} sb.append(n) sb.append sb n sb.append(' ') sb.append sb ' ' sb.deleteCharAt(sb.length() - 1) sb.deleteCharAt sb sb.length() - 1 sb.length() sb.length sb 1 sb.append('\n') sb.append sb '\n' sb.append(cnt_swap) sb.append sb cnt_swap System.out.println(sb) System.out.println System.out System System.out sb String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	}
} Main
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {
	public static void main(String[] args) throws Exception {
		List<Integer> A = new ArrayList<Integer>();
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		// BufferedReader br = new BufferedReader(new FileReader("in1.txt"));
		// BufferedReader br = new BufferedReader(new FileReader("in2.txt"));
		int N = Integer.parseInt(br.readLine());
		String[] s_in = br.readLine().split(" ");
		for (String s : s_in)
			A.add(Integer.parseInt(s));
		
		int cnt_swap = 0;
		for (int i = 0; i < N; i++) {
			// A[0..i-1]??????????????????
			int mini = i;
			for (int j = i + 1; j < N; j++)
				if (A.get(j) < A.get(mini))
					mini = j;
			if (mini != i) {
				int tmp = A.get(i);
				A.set(i, A.get(mini));
				A.set(mini, tmp);
				cnt_swap++;
			}
		}
		
		StringBuilder sb = new StringBuilder();
		for (int n : A) {
			sb.append(n);
			sb.append(' ');
		}
		sb.deleteCharAt(sb.length() - 1);
		sb.append('\n');
		sb.append(cnt_swap);
		System.out.println(sb);
	}
}