import copy
n = int(input())
s = input()
l = list(s)
ll = copy.copy(l)
bnextb = 0
btow = 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
  print(min(bnextb,btow))