n = int(input())
s = input() + 'a'

counts = [s.count('.'), s.count('#')]
for i, stone in enumerate(s):
  if stone == '.' and s[i+1] == '#':
    counts.append(s[:i].count('#') + s[i:].count('.'))
    
print(min(counts))