import { SIGALRM } from 'constants';

namespace Coder {
  class Scanner {
    private buffer: string = '';
    private stdinQueue: any = [];

    constructor() {
      process.stdin.resume();
      process.stdin.setEncoding('utf8');
      process.stdin.on(
        'data',
        (chunk): void => {
          this.buffer += chunk;
          while (this.stdinQueue.length > 0) {
            const i = this.buffer.indexOf('\n');
            if (i < 0) {
              break;
            }
            let line = this.buffer.substr(0, i);
            if (line.endsWith('\r')) {
              line = line.slice(0, -1);
            }
            this.buffer = this.buffer.substr(i + 1);
            this.stdinQueue.shift()(line);
          }
        },
      );
    }
    public getLine(): Promise<string> {
      return new Promise((resolve, reject) => {
        const i = this.buffer.indexOf('\n');
        if (i >= 0 && this.stdinQueue.length === 0) {
          let line = this.buffer.substr(0, i);
          if (line.endsWith('\r')) {
            line = line.slice(0, -1);
          }
          this.buffer = this.buffer.substr(i + 1);
          resolve(line);
        } else {
          this.stdinQueue.push(resolve);
        }
      });
    }

    public async getNumbers(): Promise<number[]> {
      return (await this.getLine()).split(' ').map((x) => +x);
    }

    public async getStrings(): Promise<string[]> {
      return (await this.getLine()).split(' ');
    }

    public close(): void {
      process.stdin.pause();
    }
  }

  async function solve() {
    const sc = new Scanner();
    const N = (await sc.getNumbers())[0];
    const S = (await sc.getStrings())[0];

    const t = S.match(/#[\.#]*[^#]+/);
    let str = '';
    if (t === null) {
      str = '';
    } else {
      str = t[0];
    }

    const len = str.split('#').length - 1;
    const len2 = str.split('.').length - 1;

    console.log(Math.min(len, len2));

    sc.close();
  }

  solve();
}
