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

sum=0
sum2=0

for i in range(1,n):
  if (a[-i] == "." and a[-i-1] == "#"):
    a[-i-1] = "."
    sum += 1
    
for i in range(n-1):
  if (c[i] == "#" and c[i+1] == "."):
    c[i+1] = "#"
    sum2 += 1
    
print(min([b.count("."),b.count("#"),sum,sum2]))