#include <bits/stdc++.h>
char s[200005];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  int count1 = 0, count2 = 0, count = 0;
  for (int i = 0; i < n; i++) {
    count1 = 0;
    count2 = 0;
    if (s[i] == '#' && s[i + 1] == '.') {
      for (int j = i; s[j] == s[i]; j--) {
        if (s[i] == s[j]) {
          count1++;
        }
      }
      for (int j = i + 1; s[j] == s[i + 1]; j++) {
        if (s[i + 1] == s[j]) {
          count2++;
        }
      }
      count += (count1 > count2 ? count2 : count1);
    }
  }
  printf("%d", count);
  return 0;
}
