#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  char white = '.', black = '#';
  int allW = 0, allB = 0, mixed = 0;
  for (int i = 0; i < s.size(); i++) {
    s.at(i) == white ? allB++ : allW++;
    if (i > 0 && s.at(i - 1) == black && s.at(i) == white) mixed++;
  }
  cout << min(allB, min(allB, mixed)) << endl;
}
