#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count = 0, count2 = 0, i;
  cin >> n;
  char s[n], s2[n];
  cin >> s;
  strcpy(s2, s);
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.') {
        s[i + 1] = '#';
        count++;
      }
    }
  }
  for (i = n - 1; i > 0; i--) {
    if (s2[i] == '.') {
      if (s2[i - 1] == '#') {
        s2[i - 1] = '.';
        count2++;
      }
    }
  }
  if (count < count2)
    cout << count << endl;
  else
    cout << count2 << endl;
  return 0;
}
