#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt_w = 0;
  bool found_b = false;
  for (int i = 0; i < n; ++i) {
    auto sub = s.substr(i, 1);
    if (sub == "#") {
      found_b = true;
    } else {
      if (found_b) ++cnt_w;
    }
  }
  int cnt_b = 0;
  bool found_w = false;
  for (int i = n - 1; i >= 0; --i) {
    auto sub = s.substr(i, 1);
    if (sub == ".") {
      found_w = true;
    } else {
      if (found_w) ++cnt_b;
    }
  }
  cout << min(cnt_b, cnt_w) << endl;
  return 0;
}
