N = int(input())
S = input()
b = []
w = []
count = 0
for i in range(N):
  tmp = S[i:]
  b.append(tmp.count('#'))
  w.append(tmp.count('.'))
bw = [b[i]-w[i] for i in range(N)]
ind = bw.index(max(bw))
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)