#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S;
  cin >> N >> S;
  long long count = 0;
  for (int i = S.size(); i > 0; i--) {
    if (i != 0) {
      count = S[i - 1] == '#' && S[i] == '.' ? count + 1 : count;
    }
  }
  cout << count << endl;
  return 0;
}
