import math

n = int(input())
s = input()
ans = 0
i = 0
c = 0

while i < n:
    if s[i:i+1] == '#':
        c += 1
        i += 1
        while s[i:i+1] == '#':
            c += 1
            i += 1
        ans += math.floor(c/2)
        c = 0
    else:
        i += 1

if s[0:2] == '#.':
    ans += 1

print(ans)