import numpy
N=int(input())
S=input()
S_modify = list(map(int,S.replace('.','0').replace('#','1')))
count_list = []

sum_list=numpy.cumsum(S_modify)
for i in range(len(S_modify)):
    w_num = sum_list[i]
    b_num= (N-i-1)-sum(S_modify[(i+1):])
    count_list.append((w_num + b_num))
print(min(count_list))