import re


N = int(input())
S = input()

match = re.match('^\.*#', S)
if match:
    first_match = len(match.group(0))
else:
    print(0)
    exit()

ca1 = S[first_match:].count('.')
ca2 = S.count('#')

print(min((ca1, ca2)))
