N=int(input())
S=list(input())
flag_b=0
sum_b=0
sum_w=0
for i in S:
    if i=="." and flag_b==1:
        sum_w+=1
    if i=="#" and flag_b==1:
        sum_b+=1
    if i=="#" and flag_b==0:
        flag_b=1
        sum_b+=1
if sum_w > sum_b:
    print(sum_b)
else:
    print(sum_w)