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