SIRO = '.'
KURO = '#'
N = int(input())
S = input()
sLst1 = []
sLst2 = []
for i in S:
    sLst1.append(i)
    sLst2.append(i)
ans = 0
kCnt = S.count(KURO)
sCnt = S.count(SIRO)
ans1 = 0
ans2 = 0
for i in range(0, N - 1):
    if sLst1[i] == KURO:
        if sLst1[i + 1] == SIRO:
            sLst1[i + 1] = KURO
            ans1 += 1
for i in range(N - 1, 0, -1):
    if sLst2[i] == SIRO:
        if sLst2[i - 1] == KURO:
            sLst2[i - 1] = SIRO
            ans2 += 1
ans = min(ans1, ans2)
print(ans)