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