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


black_count = 0
white_count = 0
right_white_pos=-1
for i in range(N):
    if(S[i]=="."):
        white_count+=1
        right_white_pos=i
    else:
        black_count+=1

counter = 0
for i in range(N):
    if(i<right_white_pos):
        if(S[i]=="#"):
            counter +=1



S_black_list=list(S)
S_white_list=list(S)

to_black_counter=0
for i in range(N-1):
    if(S_black_list[i]=="#" and S_black_list[i+1]=="."):
        to_black_counter+=1
        S_black_list[i+1]="#"

to_white_counter=0

for i in range(N-1, 0, -1):
    if(S_white_list[i]=="." and S_white_list[i-1]=="#"):
        to_white_counter+=1
        S_white_list[i-1]="."


print(white_count)
print(black_count)
print(counter)
print(to_black_counter)
print(to_white_counter)
print(int(min(white_count, black_count, counter, to_black_counter, to_white_counter)))


'''
black_count = 0
white_count = 0
right_white_pos=-1
for i in range(N):
    if(S[i]=="."):
        white_count+=1
        right_white_pos=i
    else:
        black_count+=1

S_black_list=list(S)

to_black_counter=0
for i in range(N-1):
    if(S_black_list[i]=="#" and S_black_list[i+1]=="."):
        to_black_counter+=1
        S_black_list[i+1]="#"


        

#print(white_count)
#print(black_count)
#print(to_black_counter)
print(min(white_count, black_count, to_black_counter))
'''
