n = int(input())
s = input()
ck = [0]
cs = [0]
c = 0
for item in s:
    if item != '.':
        c += 1
    cs.append(c)
c = 0
for item in s[::-1]:
    if item != '#':
        c +=  1
    ck.insert(0, c)
ck.insert(0, 0)

temp = [cs[i] + ck[i+1] for i in range(len(s)+1)]

print(min(temp))
