N = int(input())
S = input()
try:
    first_black = S.index('#')
    target = S[first_black:]
    length = N - first_black
    black = target.count('#')
    print(min(black, length - black))
except ValueError:
    print(0)
