#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string s1;
  int min = 999999;
  int k = 0;
  int flag = 0;
  for (int i = 0; i < n; i++) {
    for (int k = 0; k < n; k++) {
      s1[k] = '.';
      if (k < i) {
        s1[k] = '.';
      } else {
        s1[k] = '#';
      }
      if (s[k] == s1[k]) {
      } else if (s[k] != s1[k]) {
        flag++;
      }
    }
    if (flag < min) {
      min = flag;
    }
  }
  cout << min << endl;
  return 0;
}
