n=int(input())
a=list(input())
b=a.copy()

sum=0

for i in range(1,n):
  if (a[-i] == "." and a[-i-1] == "#"):
    a[-i-1] = "."
    sum += 1

if b.count(".") < sum:
  sum = b.count(".")
    
print(sum)