def chec(s):
    clis = 0
    lef = 0
    rig = 0
    rtmp = 0
    ltmp = 0
    for i in range(len(s)):
        if i+1 != len(s) and s[i] == '#' and s[i+1] == '.' :
            clis+= 1
            rtmp = i + 1
            ltmp = i
            while ltmp != 0 and s[ltmp] == s[ltmp-1]:
                lef += 1
                ltmp -= 1
            while rtmp + 1 != len(s) and s[rtmp] == s[rtmp+1]:
                rig += 1
                rtmp += 1
            clis += min(lef,rig)
            lef = 0
            rig = 0
            rtmp = 0
            ltmp = 0
                
    return clis


n = int(input())
s = list(input())
print(chec(s))