N=int(input())
S=input()
same=''
before=''
count=0
count_list=[]
for i,moji in enumerate(S):
    count+=1
    if moji!=before:
        same+=moji
        before=moji
        count_list.append(count)
        count=0
    elif i-1==len(S):
        count_list.append(count)
cand=[]
length=len(count_list)
ki=0
if length%2==1:
    ki=1

if same[0]=='.':
    count_list=count_list[1:]
    max_num=length-1//2
    for i in range(length-1//2+1):
        cand.append(sum(count_list[0:max_num-i*2:2])+sum(count_list[i*2+1::2]))
else:
    max_num=length//2
    for i in range(length//2+1):
        cand.append(sum(count_list[0:length-i*2-ki:2])+sum(count_list[length-i*2:length:2]))
        #print(length-i*2-ki)
        #print(count_list[i*2+1::2])
print(min(cand))