#include <bits/stdc++.h>
using namespace std;
int n, ans = 0;
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i <= s.size() - 2; i++) {
    if (s[i] == '#' && s[i + 1] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
