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