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