#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const ll MOD = 1000000007;
const long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
void solve() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll ans = 0;
  for (long long i = 0; i < s.size() - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      if (i >= 1 && s[i - 1] == '#')
        s[i + 1] = '#';
      else
        s[i] = '.';
      ans++;
    }
  }
  std::cout << (ans) << "\n";
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  cout << fixed << setprecision(12);
  solve();
}
