#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int maxn = 1;
const double EPS = 1e-8;
class CStones {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n;
    string s;
    in >> n >> s;
    int res = n;
    std::vector<int> sumw(n, 0), sumb(n, 0);
    int t1 = 1, t2 = 1;
    for (int i = 0; i < n; ++i) {
      if (s[i] == '.') {
        sumw[i] = 1;
      } else {
        sumb[i] = 1;
      }
      if (i) {
        sumw[i] += sumw[i - 1];
        sumb[i] += sumb[i - 1];
      }
    }
    if (n >= 2) {
      for (int i = 1; i < n; ++i) {
        if (s[i] != s[i - 1]) {
          res = min(res, sumb[i] + sumw[n - 1] - sumw[i]);
          res = min(res, sumb[i - 1] + sumw[n - 1] - sumw[i - 1]);
        }
      }
    }
    if (sumb[n - 1] == n || sumw[n - 1] == n) res = 0;
    out << res << endl;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  CStones solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
