from sys import stdin
from re import findall

readline = stdin.readline

_ = readline()
s = readline().rstrip().rstrip('#')

a = findall(r'#+\.+', s)
c = ''.join(a)

print(min(c.count('#'), c.count('.')))
