n = int(input())
s = input()
ans = 999999999999999999
w = s[0].count('#')
b = s[1:].count('.')
ans = w + b
for i in range(1, n):
    if s[i] == '.':
        w -= 1
    else:
        b += 1
    ans = min(ans, w + b)
print(ans)