#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  while (scanf("%d", &a) != EOF) {
    string temp;
    cin >> temp;
    int count = 0;
    for (int i = 0; i < a - 1; i++) {
      if (temp[i] == '#' && temp[i + 1] == '.') {
        if (temp[i - 1] != '#')
          temp[i] = '.';
        else
          temp[i + 1] = '#';
        count++;
      }
    }
    printf("%d\n", count);
  }
}
