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

c = [0]
cc = [0]
for i in range(n):
  if s[i] == ".":
    c.append(c[-1]+1)
    cc.append(cc[-1])
  else:
    c.append(c[-1])
    cc.append(cc[-1]+1)
c = c[1:]
cc = cc[1:]

ans = n
for i in range(n):
  ans = min(ans, cc[i]+c[-1]-c[i])
print(ans)