#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0, white = 0, black = 0;
  long long first = 1e9, last = 0;
  bool ok = false;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      if (first > i) first = i;
      if (last < i + 1) last = i + 1;
      ok = true;
    }
  }
  if (ok) {
    for (int i = 0; i < last; i++) {
      if (s[i] == '#') white++;
    }
    for (int i = n - 1; i >= first; i--) {
      if (s[i] == '.') black++;
    }
  }
  ans = min(white, black);
  cout << ans << endl;
}
