console.log((args=>{
  const [n,S] = args.trim().split`\n`;
  const N = n|0, w = Array(N+1).fill(0);
  for ( let i = N; i--;) w[i] = w[i+1] + (S[i]==='.');
  let b = 0, min = 2e5;
  for ( let i = 0; i < N; i++ ) min = Math.min(min,w[i]+b), b+=S[i]==='#';
  return `${Math.min(min,b)}`;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
