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