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

sl = []
for i in range(n):
    sl += s[i]

cs = []
l = ['.']*n
for i in range(n+1):
    c=0
    for k in range(n):
        if i <= k and sl[k] != '#':
                c += 1
        elif k < i and sl[k] != '.':
                c += 1
    cs += [c]
print(min(cs))