n = int(input())
s = list(input())
t = s.copy()
b = 0
w = 0

for i in range(n-1):
    if s[i] == "#" and s[i+1] == ".":
        s.pop(i)
        s.insert(i, ".")
        b += 1

for i in range(n-1):
    if t[i] == "#" and t[i+1] == ".":
        t.pop(i+1)
        t.insert(i+1, "#")
        w += 1

print(min(b,w))
