#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);
    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) {
        res =
            min(res, (i - sumw[i - 1]) + (n - i - (sumb[n - 1] - sumb[i - 1])));
      }
    }
    res = min(n - sumb[n - 1], n - sumw[n - 1]);
    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;
}
