#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int white = 0;
  int count = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s.at(i) == '.' & white == 0) {
      white++;
    } else if (s.at(i) == '#' & white != 0) {
      count = count + white;
      white = 0;
    }
  }
  cout << count << endl;
}
