#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int tong = 0;
  cin >> n;
  char *s = new char[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      int den = 0;
      int trang = 0;
      for (int j = i + 1; j < n; j++) {
        if (s[i + 1] == s[j])
          den++;
        else
          break;
      }
      for (int j = i; j >= 0; j--) {
        if (s[i] == s[j])
          trang++;
        else
          break;
      }
      if (den >= trang)
        tong += trang;
      else
        tong += den;
    }
  }
  cout << tong << endl;
  delete[] s;
  return 0;
}
