n = int(input())
s = input()
wtob_res = 0
wtob_flag = False
btow_res = 0
btow_flag = False
for i in range(n):
  wtob_flag = wtob_flag or s[i] == '#'
  if wtob_flag and s[i] == '.':
    wtob_res += 1
  btow_flag = btow_flag or s[n - 1 - i] == '.'
  if btow_flag and s[n - 1 - i] == '#':
    btow_res += 1
    
print(min(btow_res, wtob_res))