#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9 + 7;
const ll LL_MAX = 0x7fffffffffffffff;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int count = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      count++;
    }
  }
  cout << count;
  return 0;
}
