#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 58;
const long long MOD = 1000000007;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
signed main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  vector<long long> b;
  b.resize(N);
  long long num = 0;
  vector<long long> c;
  c.resize(N + 1);
  c[0] = 0;
  vector<long long> d;
  d.resize(N + 1);
  d[0] = 0;
  for (long long i = 0; i < N; i++) {
    if (S[i] == '.') {
      b[i] = false;
      c[i + 1] = c[i] + 1;
      d[i + 1] = d[i];
    } else {
      b[i] = true;
      num++;
      c[i + 1] = c[i];
      d[i + 1] = d[i] + 1;
    }
  }
  long long ans = INF;
  long long tmp;
  for (long long i = 0; i < N; i++) {
    tmp = c[i + 1] + d[N] - d[i + 1];
    chmin(ans, tmp);
  }
  cout << ans << endl;
}
