a = int(input())
b = list(str(input()))

try:
    firstb = b.index('#')
except ValueError:
    firstb = len(b) + 1

numberb = b[firstb:].count('#')
if b[-1] == '#':
    numberb -= 1
numberw = b[firstb:].count('.')

breverse = b
breverse.reverse()
firstw = breverse.index('.')
numberbreverse = breverse[firstw:].count('#')

ttt = []
ttt.append(numberb)
ttt.append(numberw)
ttt.append(numberbreverse)

print(min(ttt))