#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int sum = 0, iter = 0;
  string s;
  vector<int> v;
  cin >> n;
  cin >> s;
  while (iter < n) {
    if (s[iter] == '#') {
      int j = 1;
      while (iter + j < n && s[iter + j] == '#') {
        j++;
      }
      v.push_back(j);
      iter += j;
    } else {
      int j = 1;
      while (iter + j < n && s[iter + j] == '.') {
        j++;
      }
      v.push_back(j);
      iter += j;
    }
  }
  if (s[0] == '.') {
    v.erase(v.begin());
  }
  for (int i = 0; i < v.size(); i += 2) {
    if (i + 1 < v.size()) {
      if (v[i] < v[i + 1]) {
        sum += v[i];
      } else {
        sum += v[i + 1];
      }
    }
  }
  cout << sum << endl;
}
