N = int(input())
S = input()
white = S.count(".")
try:
    bindex = S.index("#")
except ValueError:
    bindex = 0
black = S[bindex:].count("#")
bwhite = S[bindex:].count(".")
print(min(black,bwhite))