#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using TP = tuple<ll, ll, ll>;
ll MOD = 1e9 + 7;
ll INF = 1LL << 58;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  ll cnts = 0;
  ll cntt = 0;
  cin >> N;
  char prevs = ' ', prevt = ' ';
  for (int(i) = 0; (i) < (N); (i)++) {
    char s, t;
    cin >> s;
    t = s;
    if ((s == '.' || s == ' ') && prevs == '#') {
      s = '#';
      cnts++;
    }
    prevs = s;
    prevt = t;
  }
  cout << min(cntt, cnts) << endl;
  return 0;
}
