n=int(input())
s=input()
S=list(s)
m=0
l=[]

for i in range(1,n):
    m=0
    for j in range(0,n):
        if j<i:
            if S[j]=='#':
                m=m+1
        
        else:
            if S[j]=='.':
                m=m+1
    
    l.append(m)

l.sort()
print(l[0])
