#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  int count = 0;
  int buff = 0;
  string s;
  bool all = true;
  cin >> n >> s;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      count += (i - buff);
      buff = i + 1;
      all = false;
    }
    if (i == n - 1 && all == false) {
      if (s[i] == '.') {
        count += (n - buff);
      }
    }
  }
  cout << count;
  return 0;
}
