import copy
n = int(input())
s = input()
l = list(s)
ll = copy.copy(l)
rl = copy.copy(l)
rll = copy.copy(l)
bnextb = 0
btow = 0
rbnextb = 0
rbtow = 0
if n == 1:
  print(0)
else:
  for i in range(n-1):
    if l[i] == "#" and l[i+1] == ".":
      l[i+1] = "#"
      bnextb += 1
  for i in range(n-1):
    if ll[i] == "#" and ll[i+1] == ".":
      ll[i] = "."
      btow += 1
  for i in range(n-1,0,-1):
    if rl[i] == "." and rl[i-1] == "#":
      rl[i-1] = "."
      rbnextb += 1
  for i in range(n-1,0,-1):
    if rll[i] == "." and rll[i-1] == "#":
      rll[i] = "#"
      rbtow += 1
  print(min(bnextb,btow,rbnextb,rbtow))