n=int(input())
s=input()
answer1=0
countB=0
countW=0
flag=True
for i in range(len(s)):
    if s[i]=="#":
        countB+=1
        flag=False
        continue
    if s[i]=="." and flag:
        countW+=1
        continue
    if s[i]=="." and  not flag:
        countW+=1
        answer1+=1
        continue
    if s[i]=="#" and  not flag:
        countB+=1
        continue


print(min(answer1,countB,countW))