n = int(input())
s = list(input())
c = 0

def check():
  for i in range(n-1):
    j = i + 1
    if s[i] == "#":
      if s[j] == ".":
        return True
  return False

while check():
    for i in range(n-1):
      j = i + 1
      if s[i] == "#":
        if s[j] == ".":
          s[j] = "#"
          c += 1

print(c)