N=input()
S=input()
S_modify = list(map(int,S.replace('.','0').replace('#','1')))

count_list = []
for i in range(len(S_modify)):
    count = 0
    count += sum(S_modify[0:(i+1)])
    count += len(S_modify[(i+1):])-sum(S_modify[(i+1):])
    count_list.append(count)
print(min(count_list))