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