#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
inline long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / GCD(a, b); }
template <class T>
bool contain(const std::string& s, const T& v) {
  return s.find(v) != std::string::npos;
}
using Edge = pair<int, long long>;
using Graph = vector<vector<int>>;
using Edge = pair<int, long long>;
int main() {
  int n;
  string S;
  cin >> n >> S;
  vector<long long> a(n);
  int b = 0, w = 0;
  for (long long i = 0; i < (long long)n; i++) {
    if (S[i] == '.')
      a[i] = 0;
    else {
      a[i] = 1;
      b++;
    }
  }
  w = n - b;
  vector<long long> sum(n + 1);
  sum[0] = 0;
  for (long long i = 0; i < (long long)n; i++) sum[i + 1] = sum[i] + a[i];
  int ans = n;
  for (long long i = 0; i < (long long)n; i++) {
    int res = 0;
    res += sum[i + 1];
    res += w - (i + 1 - sum[i + 1]);
    ans = min(ans, res);
  }
  cout << ans << endl;
}
