n=int(input())
s=input()

#all白
s1=len([w for w in s if w=="#"])

#all黒
s2=len([w for w in s if w!="#"])

#右1黒
if s[-1]=="#":
  s3=len([w for w in s[:-1] if w=="#"])
else:
  s3=len([w for w in s if w=="#"])

print(min([s1,s2,s3]))