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

p = s.count('.')
q = 0
r = p

for i in range(n):
    if s[i] == '#':
        q += 1
    else:
        p -= 1
    # r = min(r, p + q)
   	r = r if r < p + q else p + q

print(r)