#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int w = 0;
  int b = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.')
      w++;
    else
      b++;
  }
  int now_w = 0;
  int now_b = 0;
  int ans = 1e9;
  if (w == 0 || b == 0) ans = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.')
      now_w++;
    else
      now_b++;
    int x = (w - now_w) + now_b;
    ans = min(ans, x);
  }
  cout << ans << endl;
  return 0;
}
