N = int(input())
S = str(input())

w = S.count('.')
b = S.count('#')
cnt = N+1
for i in range(1, N+1):
  tmp = S[:i].count('#') + S[i:].count('.')
  cnt = min(cnt, tmp)
    
ans = min(w, b, cnt)
print(ans)