n = int(input())
s = input()
isBlack = 0
cwhite = 0
cblack = 0


for i in range(n):
  if s[i] == "#":
    isBlack = 1
    cblack += 1
  if s[i] == "." and isBlack == 1:
    cwhite += 1
print(min(cblack, cwhite))