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

left_black = s[0].count('#')
right_white = s[1:].count('.')
suml = []
suml.append(left_black + right_white)
for i in range(1, n - 1):
    left_black = s[:i].count('#')
    right_white = s[i + 1:].count('.')
    suml.append(left_black + right_white)

if s.count('.') == n:
    print(0)
else:
    print(min(suml))