import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} main {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	} BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} NumberFormatException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} IOException e {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} e.printStackTrace() e.printStackTrace e {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} int lim = Integer.parseInt(in.readLine()); lim Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in String[] nums = in.readLine().split(" "); nums in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int[] a = new int[lim]; a new int[lim] lim for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				a[i] = Integer.parseInt(nums[i]);
			} {
				a[i] = Integer.parseInt(nums[i]);
			} a[i] = Integer.parseInt(nums[i]) a[i] a i Integer.parseInt(nums[i]) Integer.parseInt Integer nums[i] nums i int cnt = 0; cnt 0 for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			} int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			} {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			} int mini = i; mini i for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				} int j = i; int j = i; j i j < a.length j a.length a a.length j++ j++ j {
					if (a[j] < a[mini]) {
						mini = j;
					}
				} {
					if (a[j] < a[mini]) {
						mini = j;
					}
				} if (a[j] < a[mini]) {
						mini = j;
					} a[j] < a[mini] a[j] a j a[mini] a mini {
						mini = j;
					} mini = j mini j if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				} i != mini i mini {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				} int tmp = a[i]; tmp a[i] a i a[i] = a[mini] a[i] a i a[mini] a mini a[mini] = tmp a[mini] a mini tmp cnt++ cnt System.out.print(a[0]) System.out.print System.out System System.out a[0] a 0 for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			} int i = 1; int i = 1; i 1 i < a.length i a.length a a.length i++ i++ i {
				System.out.print(" " + a[i]);
			} {
				System.out.print(" " + a[i]);
			} System.out.print(" " + a[i]) System.out.print System.out System System.out " " + a[i] " " a[i] a i System.out.println() System.out.println System.out System System.out System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
	    
		try {
			int lim = Integer.parseInt(in.readLine());

			String[] nums = in.readLine().split(" ");
			int[] a = new int[lim];
			
			for (int i = 0; i < a.length; i++) {
				a[i] = Integer.parseInt(nums[i]);
			}
			
			int cnt = 0;
			for (int i = 0; i < a.length; i++) {
				int mini = i;
				for (int j = i; j < a.length; j++) {
					if (a[j] < a[mini]) {
						mini = j;
					}
				}

				if (i != mini) {
					int tmp = a[i];
					a[i] = a[mini];
					a[mini] = tmp;
					cnt++;
				}
			}
			
			System.out.print(a[0]);
			for (int i = 1; i < a.length; i++) {
				System.out.print(" " + a[i]);
			}
			System.out.println();
			
			System.out.println(cnt);
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}