#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e8;
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int countB = 0;
  int countW = 0;
  int countLeft = 0;
  int countRight = 0;
  bool testBool = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      countLeft++;
    } else {
      break;
    }
  }
  testBool = false;
  for (int i = n - 1; i >= 0; i++) {
    if (s[i] == '#') {
      countRight++;
    } else {
      break;
    }
  }
  for (int i = countLeft; i < n - countRight; i++) {
    if (s[i] == '#') {
      countB++;
    } else {
      countW++;
    }
  }
  cout << min(countB, countW) << endl;
}
