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