def chec(s):
    llis = []
    rlis = []
    clis = 0
    lef = 0
    rig = 0
    rtmp = 0
    ltmp = 0
    flg = 0
    na = len(s)
    for i in reversed(range(0,na-1)):
        if i != na and s[i] == '#' and s[i+1] == '.' :
            #clis+= 1
            print(i)
            rtmp = i+1
            ltmp = i
            while ltmp != -1 and s[ltmp] == '#':
                lef += 1
                ltmp -= 1
            llis.append(lef)
            while rtmp != na and s[rtmp] == '.':
                rig += 1
                rtmp += 1
            rlis.append(rig)
            lef = 1
            rig = 1
            rtmp = 0
            ltmp = 0

    print(llis)
    print(rlis)
    clis = min(sum(llis),sum(rlis))
    return clis


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