n,s=int(input()),input()
w,b=s[0],s[-1]
wc,bc=0,0
for i in range(n-1):
  if b[0]=="."and"#"==s[n-2-i]:b="."+b;bc+=1
  else:b=s[n-2-i]+b
  if w[-1]=="#"and"."==s[i+1]:w+="#";wc+=1
  else:w+=s[i+1]
print(min(bc,wc))