#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INFi = 2147483647;
const long long INFl = 9223372036854775807LL;
template <typename T>
T abs(T a, T b) {
  return max(a, b) - min(a, b);
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, ans = 0, l;
  string s;
  cin >> n >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') ans++;
  }
  l = s.size();
  cout << min(ans, l - ans) << "\n";
}
