N = int(input())
S = input()
flg = 0
cntB = 0
cntW = 0

for i in range(N):
    if S[i] == '#':
        flg = i
        break

for j in range(N - flg):
    if S[flg + j] == '.':
        cntB += 1
    if S[flg + j] == '#':
        cntW += 1

print(min(cntB, cntW))
