n = int(input())
s = input()
b = [0] * (n + 1)
w = [0] * (n + 1)

for i, v in enumerate(s, start=1):
    if v == '#':
        b[i] = b[i-1] + 1
        w[i] = w[i-1]
    else:
        b[i] = b[i-1]
        w[i] = w[i-1] + 1

wn = [w[-1] - i for i in w]