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