#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n >> s;
  int whn = 0, bln = 0, lekp = 0, lewp = 0, rikp = n, aaa = 0, bbb = 0, ccc = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      whn++;
    } else {
      bln++;
    }
    if (aaa == 0 && s[i] == '#') {
      lekp = i + 1;
    } else {
      aaa = 100;
    }
    if (ccc = 0 && s[i] == '.') {
      lewp = i + 1;
    } else {
      ccc = 100;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (bbb == 0 && s[i] == '#') {
      rikp--;
    }
    if (s[i] == '.') {
      bbb = 100;
    }
  }
  if (whn > bln + rikp - n) {
    cout << bln + (rikp - n) - lekp;
  } else {
    cout << whn;
  }
}
