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