#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, string>;
using Map = map<string, ll>;
int main() {
  ll N;
  cin >> N;
  string S;
  cin >> S;
  ll ans = 0;
  for (ll i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') ans++;
    ;
  }
  cout << ans << endl;
  return 0;
}
