SIRO = '.'
KURO = '#'
N = int(input())
S = input()
ans = 0
bFlg = False
for j in range(N):
    for i in range(0, N - 1):
        if S[i] == KURO:
            if S[i + 1] == SIRO:
                S[i]
                ans += 1
                bFlg = True
    if bFlg:
        break

print(ans)