import re

n = int(input())
s = input()

cntList = list()
for i in range(n+1):
    tmp = len(re.findall('#', s[:i]))
    tmp += len(re.findall('\.', s[i:]))
    cntList.append(tmp)

print(min(cntList))
