#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int count, ans;
  cin >> n >> s;
  ans = n;
  for (int i = 0; i < n; i++) {
    string test;
    for (int j = 0; j < n; j++) {
      if (j > i)
        test += '.';
      else
        test += '#';
    }
    count = 0;
    for (int j = 0; j < n; j++) {
      if (test[j] == s[j]) count++;
    }
    ans = min({count, n - count, ans});
  }
  cout << ans << endl;
  cin >> n;
  return 0;
}
