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

cost=[]
left=0
right=0
for i in range(N):
	if S[i]=='#':
		right+=1

cost.append(N-right)
for i in range(0,N):
	if S[i]=='#':
		left+=1
		right-=1
	print(left,right)
	cost.append(left+N-i-1-right)

cost.sort()
print(cost[0])