#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using Graph = vector<vector<int>>;
using Edge = map<pair<int, int>, int>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  cout << fixed << setprecision(15);
  long long N;
  string S;
  cin >> N;
  cin >> S;
  vector<long long> white(N, 0);
  vector<long long> black(N, 0);
  long long whitetotal = 0;
  long long blacktotal = 0;
  for (long long i = 0; i < (long long)(N); ++i) {
    if (i != 0) {
      white[i] = white[i - 1];
      black[i] = black[i - 1];
    }
    if (S[i] == '.') {
      white[i]++;
      whitetotal++;
    } else {
      black[i]++;
      blacktotal++;
    }
  }
  long long ans = LINF;
  for (long long i = 0; i < (long long)(N - 1); ++i) {
    ans = min(ans, black[i] + (whitetotal - white[i]));
  }
  ans = min(ans, blacktotal);
  cout << ans << endl;
  return 0;
}
