N = int(input())
A = list(map(int,input().split()))
cnt = 0
for i in range(N):
    minj = i
    for j in range(i+1,N):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i],A[minj] = A[minj],A[i]
        cnt += 1
print(*A)
print(cnt)
 N = int(input()) N int(input()) int input() input A = list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i in range(N):
    minj = i
    for j in range(i+1,N):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i],A[minj] = A[minj],A[i]
        cnt += 1 i range(N) range N minj = i minj i for j in range(i+1,N):
        if A[j] < A[minj]:
            minj = j
     j range(i+1,N) range i+1 i 1 N if A[j] < A[minj]:
            minj = j
     A[j] < A[minj] A[j] A j A[minj] A minj minj = j minj j if i != minj:
        A[i],A[minj] = A[minj],A[i]
        cnt += 1 i != minj i minj A[i],A[minj] = A[minj],A[i] A[i] A i A[minj] A minj A[minj] A minj A[i] A i cnt += 1 cnt 1 print(*A) print *A A print(cnt) print cnt N = int(input()) int(input()) N minj = i i minj minj = j j minj A = list(map(int,input().split())) list(map(int,input().split())) A cnt = 0 0 cnt cnt += 1 1 cnt
N = int(input())
A = list(map(int,input().split()))
cnt = 0
for i in range(N):
    minj = i
    for j in range(i+1,N):
        if A[j] < A[minj]:
            minj = j
    if i != minj:
        A[i],A[minj] = A[minj],A[i]
        cnt += 1
print(*A)
print(cnt)

