#include <bits/stdc++.h>
template <class T>
inline T chmax(T& a, const T b) {
  return a = (a < b) ? b : a;
}
template <class T>
inline T chmin(T& a, const T b) {
  return a = (a > b) ? b : a;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const ll MOD = 1000000007;
const ll INF = 1e18;
const double PI = acos(-1);
using namespace std;
signed main() {
  ll N;
  cin >> N;
  string s;
  cin >> s;
  ll ans = 0;
  for (ll i = 0; i < ll(N - 1); ++i) {
    if (s[i] == '#' && s[i + 1] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
