n = int(input())
inputS=input()
listS=list(inputS)
count=0
flag=1
while flag:
    flag=0
    index=0
    bef=0
    while index < len(listS):
        if index == 0:
            bef = listS[index]
        else:
            if bef == "#":
                if listS[index] == ".":
                    listS[index-1]="."
                    flag=1
                    count+=1
            bef = listS[index]
        index+=1
listS2 = list(inputS)
count2 = 0
flag = 1
while flag:
    flag = 0
    index = 0
    bef = 0
    while index < len(listS2):
        if index == 0:
            bef = listS2[index]
        else:
            if bef == "#":
                if listS2[index] == ".":
                    listS2[index] = "#"
                    flag = 1
                    count2 += 1
            bef = listS2[index]
        index += 1
print(min(count, count2))