n = int(input())
s = input()
r = 0
l = 0
for i in range(n):
    if s[i:i+1] == ".":
        r += 1
ans = 10**9
for i in range(n):
    if s[i:i+1] == ".":
        r -= 1
    else:
        l += 1
    if l+r < ans:
        ans = l+r
print(ans)