N = input()
stone = input()
 
 
for i in range(len(stone) - 1):
  if stone[i] == '#' and stone[i+1] == '.':
    cnt_b = 0
    cnt_w = 0
    for s in stone[i:]:
      if s == '.':
        cnt_w += 1
      else:
        cnt_b += 1
        
    print(min(cnt_b, cnt_w))
    exit()
 
print('0')