n=int(input())  #数値入力
s=input()

pat1  = min(s.count('.'), s.count('#'))

l = []
for i in range(n-1):
#     print(i)
    l.append(s[:i+1].count('#') + s[i+1:].count('.'))
pat2 = min(l)

print(min(pat1, pat2))