#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int mod = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.length() - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
