n = int(input())
s = input()
cs = []
for i in range(n+1):
    c=0
    for k in range(n):
        if (i <= k and s[k] != '#') or (k < i and s[k] != '.'):
                c += 1
    cs += [c]
print(min(cs))