n = int(input())
s = list(input())

cnt = 0
for i in range(len(s)-2):
    if s[i] == '#' and s[i+1] == '.':
        if s[i+2] == '.':
            s[i] = '.'
        else:
            s[i+1] = "#"

        cnt += 1

if s[-2] == "#" and  s[-1] == ".":
    s[-1] = "#"
    cnt += 1

print(cnt)
