import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
s = list(ns())
count = 0
minn = 10 ** 9
for i in range(n + 1):
    minn = min(minn, s[:i].count('#') + s[i:].count('.'))
print(minn)
