#include <bits/stdc++.h>
using namespace std;
int main() {
  int size, c = 0;
  cin >> size;
  char arr[200005];
  cin >> arr;
  for (int i = 0; i < size - 1; i++) {
    if (arr[i] == '#')
      if (arr[i + 1] == '.') {
        arr[i + 1] = '#';
        c++;
      }
  }
  cout << c << endl;
  return 0;
}
