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

w1=[0 for i in range(n+1)]
b1=[0 for i in range(n+1)]

for i in range(1,n+1):
    w1[i]=w1[i-1]
    b1[i]=b1[i-1]
    if s[i-1]=='.':
        w1[i]+=1
    else:
        b1[i]+=1
        
w1.pop(0)
#print(w1)

s=s[::-1]
w2=[0 for i in range(n+1)]
b2=[0 for i in range(n+1)]

for i in range(1,n+1):
    w2[i]=w2[i-1]
    b2[i]=b2[i-1]
    if s[i-1]=='.':
        w2[i]+=1
    else:
        b2[i]+=1

b2.pop(0)
b2=b2[::-1]
#print(b2)

ans=10**10
for i in range(n):
    ans=min(ans,w1[i]+b2[i])

print(ans)