#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  bool flaga = false, flagb = false;
  for (int i = 0; i < n; ++i) {
    static char a;
    cin >> a;
    s.push_back(a);
  }
  int ansb = 0, answ = 0;
  for (int i = 0; i < n; ++i) {
    if (!flaga) {
      if (s.at(i) == '.' ||
          ((s.at(i) != '.') && (i != 0) && (s.at(i - 1) == '.')))
        flaga = !flaga;
    } else {
      if (s.at(i) == '#')
        ++ansb;
      else if (s.at(i) == '.')
        flaga = !flaga;
    }
    if (!flagb) {
      if (s.at(i) == '#') flagb = !flagb;
    } else {
      if (s.at(i) == '.') ++answ;
    }
  }
  cout << min(ansb, answ) << endl;
  return 0;
}
