N=input()
S=list(map(str,input()))
while len(S)!=0 and (S[0]=="." or S[-1]=="#"):
    if S[0]==".":
        S.pop(0)
    else:
        S.pop(-1)
    
#blcok to white
b_index_num = [n for n,v in enumerate(S) if v =='#']

#white to block
w_index_num = [n for n,v in enumerate(S) if v =='.']
print(min([len(b_index_num),len(w_index_num)]))
