#include <bits/stdc++.h>
using namespace std;
int main() {
  int counter, i, n, counter2, j;
  string s, str;
  cin >> n;
  cin >> s;
  counter = 0;
  counter2 = 1000000000;
  for (i = 0; i < n; i++) {
    str[i] = '.';
  }
  for (i = n - 1; i >= -1; i--) {
    counter = 0;
    for (j = n - 1; j >= 0; j--) {
      if (s[j] != str[j]) {
        counter++;
      }
    }
    if (i != -1) {
      str[i] = '#';
    }
    if (counter2 > counter) {
      counter2 = counter;
    }
  }
  cout << counter2 << endl;
}
