#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = pow(10, 18) + 1;
template <typename T>
bool chmin(T& a, T b) {
  return a > b ? a = b, true : false;
}
template <typename T>
bool chmax(T& a, T b) {
  return a < b ? a = b, true : false;
}
int main() {
  ll N;
  string S;
  cin >> N >> S;
  int res1 = 0;
  int res2 = 0;
  for (int i = (int)(0); i < (int)(S.length()); ++i) {
    if (S.substr(i, 1) == "#")
      res1++;
    else
      res2++;
  }
  cout << min(res1, res2) << endl;
  return 0;
}
