import string

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

left_black = s.find('#')
right_white = s.rfind('.')

# print(left_black)
# print(right_white)
# print(s[left_black+1:])
# print(s[:right_white])
# print(s[left_black+1:].count('.'))
# print(s[:right_white].count('#'))

print(min(s[left_black+1:].count('.'), s[:right_white].count('#')))