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

print(min(shCounter, dotCounter))