N = int(input())
S = input()
if S.count('#') < S.count('.'):
  ans = S.count('#')
else:
  ans = S.count('.')
for i in range(N):
  tmp = S[:i]
  tmp2 = S[i:]
  A = tmp.count('#')+tmp2.count('.')
  if A<ans:
    ans = A
print(ans)
