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