num = int(input())
a = input()
a = list(a)
b = a.count(".")
c = a.count("#")
count = 0
for i in range(num):
  if b <= c:
    if i <= num-2 and a[i] == "#" and a[i+1] == ".":
      count += 1
      a[i+1] = "#"
  else:
    if i <= num-2 and a[i] == "#" and a[i+1] == ".":
      count += 1
      a[i] = "."
print(count)