#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> s(n);
  char l;
  for (int i = 0; i < n; i++) {
    cin >> l;
    if (l == '.') {
      s.at(i) = 0;
    } else {
      s.at(i) = 1;
    }
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == 1) {
      int j = i;
      int count_after = 0, count_befor = 0;
      while (s.at(j) != 1 || j < n) {
        count_after++;
        j++;
      }
      int k = i - 1;
      while (s.at(k) != 1 || k >= 0) {
        count_befor++;
        k--;
      }
      if (count_after > count_befor) {
        s.at(i) = 0;
        count++;
      }
    }
    if (i < n) {
      if (s.at(i) == 1 && s.at(i + 1) == 0) {
        s.at(i + 1) = 1;
        count++;
      }
    }
  }
  cout << count << endl;
}
