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('.')

print(min(ans_1,ans_2))