n = int(input())
s = input()
left = []
right = [0 for i in range(n)]
br = 0
for i in range(n):
    if s[i] == "#":
        br += 1
    left.append(br)
br = 0
for i in range(n):
    if s[n - i - 1] == ".":
        br += 1
    right[n - i - 1] = br
p = []
for i in range(n - 1):
    p.append(left[i] + right[i + 1])
p.append(left[n - 1])
print(min(p))
