#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, n;
  cin >> n;
  string a;
  cin >> a;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == '#') {
      if (a[i + 1] == '.') {
        sum++;
        a[i + 1] = '#';
      }
    }
  }
  cout << sum;
}
