n=int(input())
st=input()
flag=False
count=0
for i in range(n):
	if st[i]=='#' and not flag:
		flag=True
	if flag and st[i]=='.':
		count+=1
count1=0
flag=False
for i in range(n):
	if st[n-i-1]=='.' and not flag:
		flag=True
	if flag and st[n-i-1]=='#':
		count1+=1
count2=st.count('#')
print(min([count,count1,count2]))