N = int(input())
S = list(input())
count=0


for i in range(N-2):
    if S[N-1-(i+2)]=='#' and S[N-1-(i+1)]=='.' and S[N-1-i]=='#':
        S[N-1-(i+1)]='#'
        count+=1
    elif S[N-1-(i+2)]=='#' and S[N-1-(i+1)]=='.' and S[N-1-i]=='.':
        S[N-1-(i+1)]='.'
        count+=1
    elif i==0 and  S[N-2]=='#' and S[N-1]=='.':
        S[N-1] = '#'
        count+=1
print(S)
print(count)