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

count=-1

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
if count==-1:
    print(0)
else:
    print(min(shiro,kuro))