N = int(input())
S = input()
i = 0
for i in range(N):
    if S[i] == '#':
        break

T = S[i:]
print(T)
W = T.count('.')

cnt = 0
B = 0
j = 0
for j in range(N - i):
    if T[j] == '#':
        cnt += 1
    else:
        B = cnt

print(min(B, W))