#include <bits/stdc++.h>
using namespace std;
using point = pair<int, int>;
using ll = long long;
int main() {
  int n;
  string str;
  scanf("%d", &n);
  cin >> str;
  int wcnt = 0, bcnt = 0;
  int tmp = 0;
  for (int i = 0; i < n; ++i) {
    if (str[i] == '.') {
      bcnt += tmp;
      tmp = 0;
    } else {
      tmp++;
    }
  }
  tmp = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (str[i] == '#') {
      wcnt += tmp;
      tmp = 0;
    } else {
      tmp++;
    }
  }
  cout << min(wcnt, bcnt) << "\n";
  return 0;
}
