#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, MOD = INF + 7;
const int N = 3e5 + 20;
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) ans += (s[i] == '#' && s[i + 1] == '.');
  cout << ans << "\n";
  return 0;
}
