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

flg = S.find('#')

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

print(min(cntB, cntW))
