#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, lw, lb = 0, rw = 0, rb = 0, mi, flag = 0;
  string s;
  vector<int> fb, v;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      rb++;
      if (flag != 1) fb.emplace_back(i);
      flag = 1;
    } else {
      rw++;
      if (flag != 0) fb.emplace_back(i);
      flag = 0;
    }
  }
  mi = min(rb, rw);
  if (!fb.empty()) lw = fb[0];
  rw -= lw;
  for (int i = 0; i < fb.size() - 1; i++) {
    if (i % 2 == 0) {
      rb -= fb[i + 1] - fb[i];
      lb += fb[i + 1] - fb[i];
    } else {
      rw -= fb[i + 1] - fb[i];
      lw += fb[i + 1] - fb[i];
    }
    v.emplace_back(lb + rw);
  }
  for (int i = 0; i < v.size(); i++) {
    mi = min(mi, v[i]);
  }
  cout << mi << endl;
}
