n = int(input())
s = list(input())
white = s.count(".")
black = s.count("#")
res = float("inf")
for index in range(n):
    if index == 0:
        continue
    if s[index-1] == "#" and s[index] == ".":
        res = min(res, s[:index].count("#")+s[index:].count("."))
print(min(res, black, white))
