
###
#main
if __name__ == "__main__":
    N = int(input())
    S = input()
#    count = 0
    countMin = 200001
    counttemp = 0
    isWhite = True
    numlist = []
    for t in S:
        if t == "#" and isWhite:
            isWhite = False
            numlist.append(counttemp)
            counttemp = 0
        if t == "." and not isWhite:
            isWhite = True
            numlist.append(counttemp)
            counttemp = 0
        counttemp += 1
    
    numlist.append(counttemp)
    if len(numlist) <= 2:
        countMin = 0
    else:
        j = 1
        while j < N:
            counttemp = 0
            i = 2
            while i < N:
                if i < j :
                    counttemp += numlist[i-1]
                else:
                    counttemp += numlist[i]
                i += 2
            if counttemp < countMin:
                countMin = counttemp
            j += 1    
#    print(numlist)           
    print(countMin)
    