N=int(input())
S=str(input())

s1=[]
s2=[]

a_min=float('inf')
a=0

if S.count('#')==N or S.count('.')==N:
    print(0)
else:
    for i in range(N+1):
        s1=S[:i]
        s2=S[i:]
        a=min(s1.count('.'),s1.count('#'))+s2.count('.')
        if a<a_min:
            a_min=a
            
    print(a_min)
