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