#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char s[200000];
  cin >> s;
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      int j = i;
      int k = i + 1;
      int jc = 0, kc = 0;
      while (s[j] == '#') {
        jc += 1;
        j--;
      }
      while (s[k] == '.') {
        kc += 1;
        k++;
      }
      if (jc < kc) {
        count += jc;
      } else {
        count += kc;
      }
    }
  }
  cout << count << endl;
}
