#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w = 0, b = 0, mi, flag = 2;
  string s;
  vector<int> fb, v;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      b++;
      if (flag == 0) fb.emplace_back(i);
      flag = 1;
    } else {
      w++;
      if (flag == 1) fb.emplace_back(i);
      flag = 0;
    }
  }
  v.resize(n);
  for (int i = 0; i < fb.size(); i++) {
    for (int j = 0; j < n; j++) {
      if ((j <= fb[i] && s[j] == '#') || (fb[i] < j && s[j] == '.')) v[i]++;
    }
  }
  mi = min(w, b);
  for (int i = 0; i < n; i++) {
    mi = min(mi, v[i]);
  }
  cout << mi << endl;
}
