#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  vector<int> sum(N + 1, 0);
  for (int i = 1; i < N; i++) {
    if (S.at(i - 1) == '#' && S.at(i) == '.') {
      sum.at(i + 1) = sum.at(i) + 1;
    } else {
      sum.at(i + 1) = sum.at(i);
    }
  }
  cout << sum.at(N) << endl;
}
