SIRO = '.'
KURO = '#'
N = int(input())
S = input()
ans = 0
kCnt = S.count(KURO)
sCnt = S.count(SIRO)
if sCnt >= kCnt:
    for i in range(0, N - 1):
        if S[i] == KURO:
            if S[i + 1] == SIRO:
                ans += 1
else:
    for i in range(1, N):
        if S[i] == SIRO:
            if S[i - 1] == KURO:
                ans += 1
print(ans)