
numbers = []
n = int(raw_input())
s = raw_input()
count = 0

numbers = s.split(" ")
for i in range(int(n)):
	numbers[i] = int(numbers[i])

for i in range(int(n)):
	minj = i
	for j in range (i, n):
		if numbers[j] < numbers[minj]:
			minj = j
	if i != minj:	
	    numbers[i], numbers[minj] = numbers[minj], numbers[i]
	    count += 1

print ' '.join([str(a) for a in numbers])
print count  numbers = [] numbers [] n = int(raw_input()) n int(raw_input()) int raw_input() raw_input s = raw_input() s raw_input() raw_input count = 0 count 0 numbers = s.split(" ") numbers s.split(" ") s.split s split " " for i in range(int(n)):
	numbers[i] = int(numbers[i]) i range(int(n)) range int(n) int n numbers[i] = int(numbers[i]) numbers[i] numbers i int(numbers[i]) int numbers[i] numbers i for i in range(int(n)):
	minj = i
	for j in range (i, n):
		if numbers[j] < numbers[minj]:
			minj = j
	if i != minj:	
	    numbers[i], numbers[minj] = numbers[minj], numbers[i]
	    count += 1 i range(int(n)) range int(n) int n minj = i minj i for j in range (i, n):
		if numbers[j] < numbers[minj]:
			minj = j
	 j range (i, n) range i n if numbers[j] < numbers[minj]:
			minj = j
	 numbers[j] < numbers[minj] numbers[j] numbers j numbers[minj] numbers minj minj = j minj j if i != minj:	
	    numbers[i], numbers[minj] = numbers[minj], numbers[i]
	    count += 1 i != minj i minj numbers[i], numbers[minj] = numbers[minj], numbers[i] numbers[i] numbers i numbers[minj] numbers minj numbers[minj] numbers minj numbers[i] numbers i count += 1 count 1 print str(a) for a in numbers for a in numbers a numbers for a in numbers str(a) str a ' '.join([str(a) for a in numbers]) ' '.join ' ' join [str(a) for a in numbers] print minj = i i minj s = raw_input() raw_input() s numbers = s.split(" ") s.split(" ") numbers count = 0 0 count count += 1 1 count numbers = [] [] numbers n = int(raw_input()) int(raw_input()) n minj = j j minj

numbers = []
n = int(raw_input())
s = raw_input()
count = 0

numbers = s.split(" ")
for i in range(int(n)):
	numbers[i] = int(numbers[i])

for i in range(int(n)):
	minj = i
	for j in range (i, n):
		if numbers[j] < numbers[minj]:
			minj = j
	if i != minj:	
	    numbers[i], numbers[minj] = numbers[minj], numbers[i]
	    count += 1

print ' '.join([str(a) for a in numbers])
print count 