n = int(input())
s = list(input())
white = s.count(".")
black = s.count("#")

color_dict = [{"w": 0, "b": 0} for x in range(n)]
for index in range(n):
    if s[index] == ".":
        color_dict[index]["w"] += 1 if index == 0 else color_dict[index-1]["w"] + 1
        color_dict[index]["b"] = color_dict[index-1]["b"]
    else:
        color_dict[index]["b"] += 1 if index == 0 else color_dict[index-1]["b"] + 1
        color_dict[index]["w"] = color_dict[index-1]["w"]

res = float("inf")
for colors in color_dict:
    w = colors["w"]
    b = colors["b"]
    res = min(res, b+(white-w))
print(res)
