#include <bits/stdc++.h>
using namespace std;
char a[200002];
int main() {
  int n, i, j, s = 0, s1 = 0, s2 = 0, x;
  scanf("%d", &n);
  scanf("%s", a);
  for (i = n; i >= 1; i--) a[i] = a[i - 1];
  a[0] = '.';
  a[n + 1] = '#';
  for (i = 1; i <= n; i++) {
    if (a[i] == '#' && a[i + 1] == '.') {
      s1 = 0;
      for (j = i; j >= 0 && a[j] != '.'; j--) s1++;
      s2 = 0;
      for (j = i + 1; j <= n && a[j] != '#'; j++) s2++;
      if (s2 < s1)
        for (j = i + 1; j <= n && a[j] != '#'; j++) a[j] = '#';
      else
        for (j = i; j >= 0 && a[j] != '.'; j--) a[j] = '.';
      x = min(s1, s2);
      s += x;
    }
  }
  printf("%d", s);
  return 0;
}
