n = int(input())
s = list(input())
sc =[]
for i in s:
  sc.append(i)
c = 0
cc = 0

def check():
  for i in range(n-1):
    j = i + 1
    if s[i] == "#" or sc[i] == "#":
      if s[j] == "." or 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

    for i in range(1,n):
      j = i - 1
      if sc[j] == "#":
        if sc[i] == ".":
          sc[j] = "."
          cc += 1
print(min(c,cc))