#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string S;
  cin >> S;
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    if (S[i - 1] == '#' && S[i] == '.') ans++;
  }
  cout << (ans) << endl;
  return 0;
}
