#include <bits/stdc++.h>
using namespace std;
void my_dbg() { cout << endl; }
template <typename Arg, typename... Args>
void my_dbg(Arg A, Args... B) {
  cout << ' ' << A;
  my_dbg(B...);
}
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9 + 7;
const int N = 2e5 + 2;
void solve() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  vi pre_b(n, 0), suf_w(n, 0);
  for (int i = (int)(0); i < (int)(n); i++) {
    pre_b[i] = s[i] == '.';
    suf_w[i] = 1 ^ pre_b[i];
  }
  for (int i = (int)(1); i < (int)(n); i++) pre_b[i] += pre_b[i - 1];
  for (int i = n - 2; i >= 0; i--) suf_w[i] += suf_w[i + 1];
  int cost = suf_w[0];
  for (int i = (int)(1); i < (int)(n - 1); i++) {
    cost = min(cost, pre_b[i - 1] + suf_w[i]);
  }
  cost = min(cost, pre_b[n - 1]);
  printf("%d\n", (int)(cost));
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
