black = '#'
white = '.'

def main():
    n = int(input())
    s = list(input())

    ans = 0
    min_num = min(s.count(black), s.count(white))
    for i in range(len(s)):
        if needToChange(s, i):
            changeStone(s, i)
            ans += 1
    print(min(ans, min_num))

def needToChange(s, i):
    if i < 0 or len(s) - 2 < i:
        return False
    if s[i] == white:
        return False
    return s[i + 1] == white

def changeStone(s, i):
    if needToChangeBlackToWhite(s, i):
        s[i] = white
    else:
        s[i + 1] = black

def needToChangeBlackToWhite(s, i):
    white_length = getAWL(s, i + 1)
    black_length = getBBL(s, i)
    return white_length > black_length

def getAWL(s, i):
    res = 0
    for j in range(i, len(s)):
        if s[j] == black:
            return res
        res += 1
    return res

def getBBL(s, i):
    res = 0
    for j in range(0, i):
        if s[i - j] == white:
            return res
        res += 1
    return res

main()
