#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  vector<int> t;
  cin >> N >> S;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#' && (i == 0 || S[i - 1] == '.')) {
      t.push_back(i);
    }
  }
  t.push_back(N);
  int res = 0;
  for (int i = 0; i < t.size(); ++i) {
    int b = 0, w = 0;
    for (int j = t[i]; j < t[i + 1]; ++j) {
      if (S[j] == '.') w++;
      if (S[j] == '#') b++;
    }
    res += w < b ? w : b;
  }
  cout << res << endl;
  return 0;
}
