#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
int main() {
  ll n;
  string s;
  cin >> n >> s;
  char a = '.', b = '.';
  ll ans = 0;
  for (auto c : s) {
    if (b == '#' && c == '.') {
      if (a == '#')
        ans++, a = b, b = '#';
      else
        ans++, a = '.', b = c;
    } else
      a = b, b = c;
  }
  cout << ans << endl;
}
