#include <bits/stdc++.h>
int main(void) {
  int n, i, j, c1 = 0, c2 = 0, count = 0;
  char s[200001];
  scanf("%d", &n);
  scanf("%s", s);
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      c1 = 0;
      c2 = 0;
      for (j = i; j < n; j++) {
        if (s[j] == '.') break;
        c1++;
      }
      for (j = i + 1; j < n; j++) {
        if (s[j] == '.') {
          c2++;
        }
      }
      if (c1 > c2) {
        puts("c2");
        count += c2;
        break;
      } else {
        puts("c1");
        count++;
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
