#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  vector<bool> b(n), c(n);
  for (int i = 0; i < n; i++) b[i] = s[i] == '#';
  if (!count(b.begin(), b.end(), true)) {
    cout << 0 << endl;
    return 0;
  }
  int r = 0;
  for (int p = 0; p < n; p++) {
    for (int i = 0; i < n; i++) c[i] = p < i;
    int t = 0;
    for (int i = 0; i < n; i++)
      if (b[i] != c[i]) t++;
    if (!r || t < r) r = t;
  }
  cout << r << endl;
  return 0;
}
