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

W=S.count('.')
B=N-W
ans_1=min(W,B)

first_b=S.find('#')
if first_b == -1:
  ans_2 = 0
else:
  S_w = S[0:first_b]
  S_b = S[first_b:N]
  ans_2 = S_w.count('#')+S_b.count('.')
  
S_rev = S[::-1]
first_w=S_rev.find('.')
if first_w == -1:
  ans_3 = 0
else:
  Srev_b = S_rev[0:first_w]
  Srev_w = S_rev[first_w:N]
  ans_3 = Srev_b.count('.')+Srev_w.count('#')


print(min(ans_1,ans_2,ans_3))