#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(int argc, char **argv) {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int res{0};
  for (int i = 0; i < n; ++i) {
    int j = i + 1;
    if (str[i] == '#') {
      for (; j < n; ++j) {
        if (str[j] == '.') ++res;
      }
    }
    i = j;
  }
  std::cout << res << std::endl;
}
