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

w = s.count(".")
b = 0

ans = 2 * 10e5 + 1

for c in s:
    if c == ".":
        w -= 1
    else:
        b += 1

    if w + b < ans:
        ans = w + b
    else:
        continue

print(ans)
