N = int(input())
S = input()
S = S[::-1]
 
a = 0
i = 0
state = ""
w_count = 0
b_count = 0
for s in S:
  if s == ".":
    w_count += 1
    if state == "b":
      if w_count > b_count:
         a += b_count
      else:
         a+= w_count
      w_count = 0
      b_count = 0
    state = "w"
  else:
    b_count += 1
    state = "b"
 
print(a)