n = int(input())
s = str(input())
ans = 200000
w = [0 for i in range(n+1)]
for i in range(n):
    if s[i] == '.':
        w[i] = w[i - 1] + 1
    else:
        w[i] = w[i - 1]
for i in range(n):
    x = (i+1 - w[i]) + (w[n - 1] - w[i])
    ans = min(x, ans)
print(ans)
