n = int(input())
s = list(input())
while True:
    if len(s) == 0 or s[0] != ".":
        break
    if s[0] == ".":
        s.pop(0)
    else:
        break
while True:
    if len(s) == 0 or s[0] != "#":
        break
    if s[-1] == "#":
        s.pop(-1)
    else:
        break

a = s.count("#")
b = s.count(".")
print(min(a,b))