#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge {
  ll from;
  ll to;
  ll cost;
};
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (!i)
      continue;
    else {
      if (s[i] == '.' && s[i - 1] == '#') ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
