#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int white_count(0);
  int black_count(0);
  for (auto&& e : s) {
    if (e == '.') {
      white_count++;
    } else {
      black_count++;
    }
  }
  int w(0);
  int b(0);
  int ans(n);
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      w++;
    } else {
      b++;
    }
    ans = min(ans, b + white_count - w);
  }
  cout << ans << endl;
}
