#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int b, w;
  b = w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  cout << (min(n - b, n - w)) << endl;
  return 0;
}
