import numpy as np

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


L = [0] * N
L1 = [0] * N
L2 = [0] * N
L3 = [0] * N
for i in range(N):
    L1[i] = 0
    L2[i] = 1
    L3[i] = 0
    if S[i] == ".":
        # white
        L[i] = 0
    else:
        L[i] = 1
L3[N-1] = 1

L = np.array(L)
L1 = np.array(L1)
L2 = np.array(L2)
L3 = np.array(L3)

a = [((L - L1)**2).sum(), ((L - L2)**2).sum(), ((L - L3)**2).sum()]
print(a)
ans = min(a)
print(ans)