N=int(input())
S=list(input())
t=0
x=[0]*N
while t<N:
    x[t]=[]
    k=0
    while k<N:
        if k<t:
            x[t].append('.')
        else:
            x[t].append('#')
        k=k+1
    t=t+1
l=0
counter=N
while l<N:
    list=x[l]
    r=0
    while r<N:
        cc=0
        if list[r]!=S[r]:
            cc=cc+1
        r=r+1
    if cc<counter:
        counter=cc
    l=l+1
m=0
ccc=0
while m<N:
    if S[m]!='.':
        ccc=ccc+1
    m=m+1
print(min(counter,ccc))