#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0, w = 0, bb = 0, ww = 0, ans = 1000000, tmpb = 0, tmpw = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.')
      w++;
    else
      b++;
  }
  if (s.at(0) == '.')
    ww++;
  else
    bb++;
  int j = 1;
  while (j < n) {
    if (s.at(j) == '.') {
      ww++;
      if (s.at(j - 1) == '#') {
        tmpb = bb;
        tmpw = w - ww;
        j++;
        while (j < n) {
          if (s.at(j) == '.') {
            tmpw--;
            j++;
          } else
            break;
        }
        if (ans > tmpb + tmpw) ans = tmpb + tmpw;
      } else
        j++;
    } else {
      bb++;
      j++;
    }
  }
  if (ans < 1000000) {
    cout << ans << endl;
  } else
    cout << 0 << endl;
}
