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