N = int(input())
S = input()
#import random
#S = "".join([["#", "."][random.randint(0, 1)] for _ in range(10)])
#print(S)
S = S[:S.rfind(".") + 1]
#print(S)
l = S.find("#") + 1
#print(S[l:])
print(min(S.count("#"), S[l:].count(".")))
