N = int(input())
S = input()

D = 0

black = S.split("#")
white = S.split(".")
if S[0] == ".":
  white.pop(0)
  
if S[-1] == "#":
  black.pop()
  
for b, i in zip(black,white):
  D += min(len(b),len(i))
  
print(D)