n = int(input())
s = input()

count_s = 0
count_d = 0
for i in range(1,n+1):
    if s[-i] == '#':
        count_s += 1
    else:
        break

for i in range(n):
    if s[i] == '.':
        count_d += 1
    else:
        break

s = s[count_d:n-count_s]
print(s)
sharp_num = s.count('#')
dot_num = s.count('.')

print(min(sharp_num,dot_num))