N=input()
S=input()
S_modify = list(map(int,S.replace('.','0').replace('#','1')))
count_list = []
for i in range(len(S_modify)):
    w_num =  sum(S_modify[0:(i+1)])
    b_num= len(S_modify[(i+1):])-sum(S_modify[(i+1):])
    count_list.append((w_num + b_num))
print(min(count_list))