N=input()
S=list(map(str,input()))
#blcok to white
b_index_num = [n for n,v in enumerate(S) if v =='#' and n!=len(S)-1]

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