size = int(input())
stone= str(input())
cnt=0
cnt2=0
cnt3=0
cnt4=0
for i in range(size):
    if(stone[i]=="."):
        cnt+=1
    else:
        cnt4+=1
        break
for i in range(size):
    if(stone[i]=="."):
        cnt2+=1
    else:
        cnt3+=1
        
if(stone[0]=="#"):
    if(cnt4>cnt2):
        print(cnt2)
    else:
        print(cnt4)
    
else:
    if(cnt2-cnt<=cnt3):
        print(cnt2-cnt)
    else:
        print(cnt3)