#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int count = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S.at(i) == '#' && S.at(i + 1) == '.') {
      int j = i;
      int countj = 0;
      while (S.at(j) == '#') {
        countj++;
        j--;
        if (j <= -1) {
          break;
        }
      }
      int k = i;
      int countk = 0;
      while (S.at(k + 1) == '.') {
        countk++;
        k++;
        if (k >= N - 2) {
          break;
        }
      }
      count += min(countj, countk);
    }
  }
  cout << count << endl;
}
