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