#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9, MOD = 1e9 + 7;
const double EPS = 1e-9, PI = 3.141592653589793;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, ans = 0;
  string s;
  cin >> n >> s;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.') ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
