#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = 0, x = 0;
  string s;
  string fs;
  cin >> n >> s;
  fs = s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      m++;
    } else {
      int k = 0;
      if (m >= n - i) {
        m = n - i;
      }
      for (int j = i; j < m; j++) {
        if (s[i] == '.') {
          k++;
        }
      }
      if (m > k) {
        x += m;
      } else {
        x += k;
      }
      m = 0;
    }
  }
  cout << x;
}
