#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
bool prime[1000001];
void sieve() {
  memset(prime, true, sizeof(prime));
  prime[1] = false;
  for (int p = 2; p * p <= 1000000; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= 1000000; i += p) prime[i] = false;
    }
  }
}
void solve() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long c = 0, c1 = 0;
  ;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      c++;
      i++;
    }
  }
  cout << c << endl;
}
int main() {
  fast();
  solve();
  return 0;
}
