#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MAX = 100005;
const int MOD = 1000000007;
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "	";
  }
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<vector<T>> &vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  string s;
  cin >> s;
  vector<long long> w(n);
  vector<long long> b(n);
  long long ans = INF;
  for (long long i = (0); i < (n); i++) {
    if (i > 0) {
      if (s[i] == *".") {
        b[i] = b[i - 1];
        w[i] = w[i - 1] + 1;
      } else {
        b[i] = b[i - 1] + 1;
        w[i] = w[i - 1];
      }
    } else {
      if (s[i] == *".") {
        w[i] = 1;
      } else {
        b[i] = 1;
      }
    }
  }
  for (long long i = (-1); i < (n); i++) {
    if (i == -1) {
      ans = min(ans, b[n - 1]);
    } else {
      ans = min(ans, b[i] + w[n - 1] - w[i]);
    }
  }
  cout << ans << endl;
  return 0;
}
