#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  string temp;
  temp = s;
  int c1 = 0, c2 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i) == '#' && s.at(i + 1) == '.') {
      s.at(i + 1) = '#';
      c1++;
    }
  }
  s = temp;
  for (int i = n - 1; i != 0; i--) {
    if (s.at(i) == '.' && s.at(i - 1) == '#') {
      s.at(i - 1) = '.';
      c2++;
    }
  }
  cout << min(c1, c2) << endl;
  return 0;
}
