import numpy as np

dic={'.':0,'#':1}
N=int(input())
S=np.array([dic[i] for i in input()])
ans=N
arr=np.ones((N,N))


if S.sum()==0:
    print(0)
elif S.sum()==N:
    print(0)    
else:
    for i in range(N):
        arr[i,:N-i]=0
        ans=min(ans,(arr[i,:]!=S).sum())
        
    print(ans)