#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const bool test = false;
long long dx[] = {1, 0, -1, 0};
long long dy[] = {0, 1, 0, -1};
const long long inf = (long long)1 << 60;
const long long undefined = inf;
const ll INFL = (ll)1 << 60;
ll mod_n = (long long)1e9 + 7;
const double eps = 1e-10;
long long sgn(const long double& r) { return (r > eps) - (r < -eps); }
long long sgn(const long double& a, const long double& b) { return sgn(a - b); }
const long long MAX = (long long)2e5 + 5;
vector<string> split(const string& str, char sep) {
  vector<string> v;
  stringstream ss(str);
  string buffer;
  while (getline(ss, buffer, sep)) {
    v.push_back(buffer);
  }
  return v;
}
string join(const vector<string>& v, const string delim = 0) {
  string s;
  if (!v.empty()) {
    s += v[0];
    for (decltype(v.size()) i = 1, c = v.size(); i < c; ++i) {
      if (delim != "") s += delim;
      s += v[i];
    }
  }
  return s;
}
string operator*(const string& s, const long long& n) {
  string res = "";
  for (long long i = 0; i < (long long)(n); ++i) res += s;
  return res;
}
template <class InputIterator>
long long sum(InputIterator begin, InputIterator end) {
  return accumulate(begin, end, 0ll);
}
template <typename T>
T gcd(T a, T b) {
  T c;
  while (a != 0) {
    c = a;
    a = b % a;
    b = c;
  }
  return b;
}
template <typename T>
T bit_count(T N) {
  T cnt = 0;
  while (N) {
    if (N & 1) cnt++;
    N >>= 1;
  }
  return cnt;
}
template <typename T>
void print_vec(ostream& ostream, vector<T> a) {
  for (long long i = 0; i < (long long)(a.size() - 1); ++i)
    ostream << a[i] << " ";
  ostream << a.back() << endl;
}
ll pow_n(ll x, ll n) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    n >>= 1;
  }
  return res;
}
template <class T, class U>
T mod_pow(T x, U n) {
  T res = 1;
  while (n > 0) {
    if (n & 1) res = res * x;
    x = x * x;
    x %= mod_n;
    n >>= 1;
    res %= mod_n;
  }
  return res;
}
template <class T>
T mod_rev(T a) {
  T res = 1;
  return mod_pow(a, mod_n - 2);
}
long long H, W;
bool grid_ng(long long y, long long x) {
  return y < 0 || y >= H || x < 0 || x >= W;
}
struct Point {
  long long x, y;
  Point(long long y_, long long x_) : y(y_), x(x_) {}
  bool operator<(const Point& r) const {
    if (y != r.y) return y < r.y;
    return x < r.x;
  }
};
long long n;
string s;
class Solver {
 public:
  void solve() {
    cin >> n >> s;
    long long cnt = 0;
    for (long long i = 0; i < (long long)(n); ++i) {
      if (s[i] == '.') cnt += 1;
    }
    cout << min(cnt, n - cnt) << endl;
  }
};
signed main() {
  srand((unsigned long long)time(NULL));
  cout << fixed << setprecision(20);
  auto ptr = new Solver();
  ptr->solve();
  delete ptr;
  return 0;
}
