#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
using ll = long long;
using ld = long double;
const int maxn = 2e5 + 100;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      if (i + 1 < n && s[i + 1] == '.') {
        s[i - 1] = '.';
        ans++;
      } else {
        s[i] = '#';
        ans++;
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
