N = int(input())
S = input()
bw = []
count = 0
max_num = 0
ind = 0
for i in range(N):
  tmp = S[i:]
  bw.append(tmp.count('#')-tmp.count('.'))
  if bw[i]>max_num:
    max_num = bw[i]
    ind = i
tmp1 = S[:ind]
tmp2 = S[ind:]
ans = 0
if tmp1.count('#') < tmp1.count('.'):
  ans += tmp1.count('#')
  if tmp2.count('#') < tmp2.count('.'):
    ans += tmp2.count('#')
  else:
    ans += tmp2.count('.')
else:
  ans += tmp1.count('.')
  ans += tmp2.count('.')
print(ans)