n=int(input())
s=list(input())
t=list(s)
s.append("0")
t.append("0")
ans1=0
ans2=0
for i in range(n):
  if s[i]=="#" and s[i+1]==".":
    s[i+1] = "#"
    ans1 += 1
for j in range(n):
  if t[n-1-j]=="." and t[n-2-j]=="#":
    t[n-2-j]="."
    ans2 += 1  
print(min(ans1,ans2))