# coding: utf-8
# Your code here!

N = int(input())
S = input()

white = S.count('.')
black = N - white

l_white = 0
l_black = 0
r_white = white
r_black = black

cost = l_black + r_white

for s in S:
    if s == '.':
        l_white += 1
        r_white -= 1
    else:
        l_black += 1
        r_black -= 1
    print(l_white, l_black, r_white, r_black)
    cost = min(cost, l_black + r_white)
    
print(cost)