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

s_w = S.count('.')
s_b = S.count('#')

if N%2 == 0:
  print( min(S[:N//2].count('#')+S[N//2:].count('.'),min(s_w,s_b)) )
else:
  print( min(S[:N//2].count('#')+S[N//2:].count('.'),S[:N//2+1].count('#')+S[N//2+1:].count('.'),min(s_w,s_b)) )


