#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  bool prev = false;
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == '#') {
      prev = true;
    }
    if (prev && S.at(i) == '.') {
      ans++;
      prev = true;
    } else if (S.at(i) == '.') {
      prev = false;
    }
  }
  cout << ans << endl;
  return 0;
}
