import numpy as np

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

arr=np.ones((N,N))
for i in range(N):
    arr[i,:N-i]=0

if S.sum()==0:
    print(0)
elif S.sum()==N:
    print(0)    
else:
    print(min((arr!=S).sum(axis=1)))