n = int(input())
listS = list(input())

index = 0
shCounter = 0
jhC = 0
while index < len(listS):
    if listS[index] == "#":
        jhC += 1
    else:
        shCounter += jhC
        jhC = 0
    index += 1

index = len(listS)-1
dotCounter = 0
jhC = 0
while index > -1:
    if listS[index] == ".":
        jhC += 1
    else:
        dotCounter += jhC
        jhC = 0
    index -= 1

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
print(min(shCounter, dotCounter, count))