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

fb=-1
flag=0
for i in range(n):
    if flag==0 and s[i]=='#':
        fb=i
        flag+=1

if fb==(n-1):
    if fb==0:
        ans=0
    else:
        ans=1
elif fb==-1:
    ans=0
else:
    w=0
    b=1
    for i in range(fb+1,n):
        if s[i]=='.':
            w+=1
        else:
            b+=1
    ans=min(w,b)

print(ans)