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

index = 0
dotCounter = 0
flag=1
while index < len(listS):
    if flag:
        if listS[index]=="#":
            flag=0
    else:
        if listS[index]==".":
            dotCounter+=1
    index+=1


index = len(listS)-1
shCounter = 0
flag = 1
while index > -1:
    if flag:
        if listS[index]==".":
            flag=0
    else:
        if listS[index]=="#":
            shCounter+=1
    index-=1
print(min(shCounter, dotCounter))