N = int(input())
S = input()

kouho = []
kouho.append(['.' for i in range(N)])
for i in range(1, N+1):
    a = kouho[-1][:]
    a[-i] = '#'
    kouho.append(a)

counts = []
for k in kouho:
    count = 0
    for i in range(N):
        if k[i] != S[i]:
            count += 1
    counts.append(count)

print(min(counts))
