#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n, k;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  for (long long i = 0; i < n - 1; ++i) {
    if (s[i] == '#')
      if (s[i + 1] == '.') {
        ans++;
        s[i + 1] = '#';
      }
  }
  cout << ans;
  return 0;
}
