#include <bits/stdc++.h>
using namespace std;
using str = string;
int gcd_euclid(int u, int v) {
  int r;
  while (0 != v) {
    r = u % v;
    u = v;
    v = r;
  }
  return u;
}
int calc_gcd(const vector<int> vec) {
  int gcd = *min_element(vec.begin(), vec.end());
  for (const int ele : vec) {
    gcd = gcd_euclid(gcd, ele);
  }
  return gcd;
}
int calc_lcm(const vector<int> vec) {
  int tmp = 1;
  for (const int ele : vec) {
    tmp *= ele;
  }
  int gcd = calc_gcd(vec);
  return tmp / gcd;
}
std::string join(const std::vector<std::string>& v, const char* delim = 0) {
  std::string s;
  if (!v.empty()) {
    s += v[0];
    for (decltype(v.size()) i = 1, c = v.size(); i < c; ++i) {
      if (delim) s += delim;
      s += v[i];
    }
  }
  return s;
}
void run() {
  int n, k;
  string s;
  cin >> n;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] == '.';
      ans++;
    }
  }
  cout << ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  run();
  return 0;
}
