n = int(input())
s = input().rstrip()
s = s.rstrip('#')
if len(s) == 0:
    print(0)
    exit()

start = s.find('#.')
if start == -1:
    print(0)
    exit()
print(min(s.count('.', start), s.count('#', start + 1)))
