#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int main() {
  ll N; cin >> N;
  string S; cin >> S;
  ll ans = 0;
  if (N == 2) {
    if (S[0] == '#' && S[1] == '.') {
      cout << 1 << endl;
      return;
    }
  }
  for (ll j=1; j < N-1; ++j) {
    if (S[j-1] == '.' && S[j] == '#' && S[j+1] == '.') {
      S[j] = '.';
      ans += 1;
    } else if (S[j-1] == '#' && S[j] == '#' && S[j+1] == '.') {
      S[j+1] = '#';
      ans += 1;
    } else if (S[j-1] == '#' && S[j] == '.') {
      S[j-1] = '.';
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
