#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  int cntw = 0, cntb = 0, w[n], b[n];
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cntw++;
    else
      cntb++;
    w[i] = cntw;
    b[i] = cntb;
  }
  if (cntw == 0 || cntb == 0) {
    cout << "0" << endl;
  } else {
    int ans = 2 * 100000, bflag = 0;
    for (int i = 0; i < n - 1; i++) {
      int tmpw = 0, tmpb = 0, tmp = -1;
      if (s[i] == '#') {
        tmpw = w[n - 1] - w[i];
        if (i == 0)
          tmpb = b[n - 1];
        else
          tmpb = b[n - 1] - b[i - 1];
        if (tmpw == 0)
          tmp = 0;
        else if (tmpw == n - i)
          tmp = 1;
        else {
          tmp = tmpw;
        }
        if (bflag == 0) {
          tmp = min(tmp, tmpb);
          bflag = 1;
        }
        ans = min(ans, tmp);
        break;
      }
    }
    cout << ans << endl;
  }
}
