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

if s.count(".") == n:
  print(0)
  exit()

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:]

a = cc.count(0)
print(min(c[-1]-a, cc[-1]-a))