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

black_sum=s.count("#")
white_sum=n-black_sum
black=0
white=0
for i in range(n):
    if s[i]==".":
        black=i
        break
    
for i in range(n):
    if s[~i]=="#":
        white=~i+n
        
ans=min(black_sum-black,white_sum-white)
print(ans)