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

out_num_list=[]
last_w=0
for i in range(N-1,-1,-1):
  if S[i] == '.':
    last_w = i
    break

change_num=0
for i in range(0,N-1):
  if S[i] == '#' and i < last_w:
    change_num+=1
    
out_num_list.append(change_num)

change_num=0
for i in range(1,N):
  if S[i] == '.':
    change_num+=1
    
out_num_list.append(change_num)

print(min(out_num_list))