n = int(input())
s = input()
b = 0
w = s.count(".")
l = []
for i in range(1, n):
    if s[i - 1] == "#":
        b += 1
    if s[i - 1] == ".":
        w -= 1
    l.append(b + w)
l.append(b)
print(min(l))