#include <bits/stdc++.h>
int main(void) {
  char str[200002];
  int count = 0, han = 0, n = 0, j = 0;
  ;
  scanf("%d", &n);
  scanf("%s", str);
  while (count < n) {
    if (str[count] == '#') {
      if (str[count + 1] == '#') {
        if (str[count + 2] == '.') {
          str[count + 2] = '#';
          han++;
          j = 1;
        }
      }
      if (count == n - 1) {
        if (str[n - 1] == '#') break;
      }
      if (j == 0 && str[count + 1] != '#') {
        str[count] = '.';
        han++;
      }
    }
    j = 0;
    count++;
  }
  printf("%d\n", han);
  return 0;
}
