#include <bits/stdc++.h>
int count;
char stone[200000];
int white() {
  int ans = 0;
  for (int i = 1; i < count; i++) {
    if (stone[i - 1] == '#' && stone[i] == '.') {
      ans++;
      stone[i] = '#';
    }
  }
  return ans;
}
int black() {
  int ans = 0;
  for (int i = 0; i < count - 1; i++) {
    if (stone[i] == '#' && stone[i + 1] == '.') {
      ans++;
      stone[i] = '.';
    }
  }
  return ans;
}
int main(int argc, char const *argv[]) {
  int ans = 0;
  scanf("%d", &count);
  scanf("%s", stone);
  int c;
  for (int i = 0; i < count; i++) {
    if (stone[i] == '.') c++;
  }
  if (c * 2 > count) {
    ans = black();
  } else {
    ans = white();
  }
  printf("%d\n", ans);
}
