n = int(input())
s = input()
ans = 10 ** 9 + 10

for i in range(1, n+1):
    left = s[:i]
    right = s[i:]
    is_black = left.count('#')
    is_white = right.count('.')
    if is_black + is_white < ans:
        ans = is_black + is_white

print(ans)