#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int result = 0;
  if (n != 1) {
    int wCount = 0, bCount = 0;
    bool w = false;
    for (int i = n - 1; i >= 0; --i) {
      if (s[i] == '.') {
        if (!w) {
          result += min(wCount, bCount);
          w = true;
          wCount = 0;
          bCount = 0;
        }
        ++wCount;
      } else {
        if (w) {
          w = false;
        }
        ++bCount;
      }
    }
    if (!w) {
      result += min(wCount, bCount);
    }
  }
  cout << result << endl;
}
