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