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

w = s.count(".")
b = s.count("#")

c = 0

if w <= (n / 2):
    for i in range(1,n):
        if s[i - 1] + s[i] == "#.":
            c = s[i - 1:].count(".")
            break
else:
    for i in range(1,n):
        if s[i -1] + s[i] == "#.":
            c = s[i - 1:].count("#")
            break
print(c)