def SS(n, a):
    count = 0
    for i in range(n):
        mini = i
        for j in range(i,n):
            if a[j] < a[mini]:
                mini = j
        a[i], a[mini] = a[mini], a[i]
        count += 1 if i == mini else 0
    return count, a
    
n = int(raw_input())
a = map(int, raw_input().split())

n, a = SS(n, a)
print " ".join(map(str, a))
print n