#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
bool compare_by_b(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}
void solve(long long N, std::string S) {
  int l = 0;
  vector<int> w(N);
  vector<int> b(N);
  int wcnt = 0;
  int bcnt = 0;
  for (int i = (0); i < (N); ++i) {
    if (S[i] == '.')
      wcnt++;
    else
      bcnt++;
    w[i] = wcnt;
    b[i] = bcnt;
  }
  int wmax = w[N - 1];
  int ans = 100000;
  for (int i = (0); i < (N); ++i) {
    ans = (ans, b[i] + wmax - w[i]);
  }
  cout << max(0, ans - 1) << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
