n=int(input())
s=list(input())
x=0
for i in range(n-1):
  if s[i]=="#" and s[i+1]==".":
    x+=1
  elif s[i]=="#" and s[i+1]=="#":
    x+=1

y=0
for i in range(n-1):
  if s[n-1-i]=="." and s[n-2-i]=="#":
    y+=1
  elif s[n-1-i]=="." and s[n-2-i]==".":
    y+=1

if x<=y:
  print(x)
else:
  print(y)