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

answer = 200000
b = 0
w = s.count(".")
if w == len(s) or s.count("#"==len(s)):
    print(0)
else:
    for i in range(len(s)):
        if s[i] == "#":
            b += 1
        else:
            w -= 1
        answer = min(answer, b+w)

    print(answer)
