n = int(input())
s = list(input())
ans = 0
for i in range(n-1):
    if s[i] == '#' and s[i+1] == '.':
        if (i+2) < n:
            if s[i+2] == '#':
                s[i+1] = '#'
            else:
                s[i] = '.'
        else:
            s[i+1] = '#'
        ans += 1
print(ans)
