# coding: utf-8
# Your code here!
N=int(input())
S=[i for i in input()]
stp=0
for i in range(N-1,-1,-1):
    if S[i]=='.':
        flg=i
        break
    else:
        if i==0:
            stp=1
            flg=0
for i in range(N):
    if S[i]=='#':
        flg2=i
        break
    else:
        if i==N-1:
            stp=1
            flg2=0
ans1=S[:flg].count('#')
ans2=S[flg2:].count('.')
ans=min(ans1,ans2)
if stp==1:
    ans=0
print(ans)