#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
using ll = long long;
template <typename T>
inline T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
inline double isint(double a) { return a >= 0 && ceil(a) == floor(a); }
int main() {
  ll N;
  string S;
  cin >> N >> S;
  ll shiro = 0, kuro = 0;
  for (int i = 0; i < (S.size()); i++) {
    if (S[i] == '#') {
      kuro++;
    } else {
      shiro++;
    }
  }
  cout << min(shiro, kuro) << endl;
  return 0;
}
