N=int(input())
A=input()
kuro=0
shiro=0

count=0

for i in range(N):
    if A[i:i+2]=="#.": 
        count=i
        break
for i in range(N):
    if A[i]=="#":
        kuro+=1

for i in range(count+1,N):
    if A[i]==".":
        shiro+=1

print(min(shiro,kuro))