#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  vector<long long> s(0);
  long long k = 1;
  for (long long i = 0; i < (long long)(N - 1); i++) {
    if (S[i] == S[i + 1])
      k++;
    else {
      s.push_back(k);
      k = 1;
    }
  }
  s.push_back(k);
  if (s.size() == 1) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 0;
  if (S[0] == '#') {
    for (long long i = 1; i < (long long)(s.size()); i += 2) ans += s[i];
    cout << ans << endl;
  } else {
    if (s.size() == 2) {
      cout << 0 << endl;
      return 0;
    }
    for (long long i = 2; i < (long long)(s.size()); i += 2) ans += s[i];
    cout << ans << endl;
  }
}
