#include <bits/stdc++.h>
const int N = 200005;
char a[N];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a);
  int ans = 0;
  for (int i = 1; i < n;) {
    if (a[i] == '.' && a[i - 1] == '#') {
      int j = i - 1, k = i;
      int sz = 0;
      while (j >= 0 && k < n && a[j] == '#' && a[k] == '.') {
        sz++;
        j--;
        k++;
      }
      ans += sz;
      i = k;
    } else {
      i++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
