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

out_num_list=[]

change_num=0
for i in range(0,N-1):
  if S[i] == '#':
    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))