#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int count;
  char stone[200000];
  char stone_b[200000];
  int ans = 0, ans_b;
  scanf("%d", &count);
  scanf("%s", stone);
  memcpy(stone_b, stone, sizeof(char) * count);
  for (int i = 1; i < count; i++) {
    if (stone[i - 1] == '#' && stone[i] == '.') {
      ans++;
      stone[i] = '#';
    }
  }
  for (int i = 0; i < count - 1; i++) {
    if (stone[i] == '#' && stone[i + 1] == '.') {
      ans_b++;
      stone[i] = '.';
    }
  }
  printf("%d\n", (ans < ans_b) ? ans : ans_b);
}
