#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  set<pair<int, char>> data;
  cin >> n >> s;
  for (int i = n; i >= 0; --i) {
    data.insert(make_pair(i, s[i]));
  }
  string ss;
  int num = 0;
  while (1) {
    int tmp = 0;
    for (auto i : data) {
      if (i.second == '.') {
        while (s[i.first + 1] == '#') {
          s[i.first + 1] = '.';
          tmp++;
        }
      }
    }
    if (tmp == 0) break;
    num += tmp;
    for (int i = n; i >= 0; --i) {
      data.insert(make_pair(i, s[i]));
    }
  }
  cout << num << endl;
  return 0;
}
