N = int(input())
S = input()
white = S.count(".")
if S[0] == "#":
    B = [1]*N
    W = [white]*N
else:
    B = [0]*N
    W = [white-1]*N
for i in range(1,N):
    if S[i] == "#":
        B[i] = B[i-1] + 1
        W[i] = W[i-1]
    else:
        B[i] = B[i-1]
        W[i] = W[i-1] - 1
print(B)
print(W)
Ans = [B[i]+W[i] for i in range(N)]
print(min(Ans))
