#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const int MIN = INT_MIN;
const long long LINF = LLONG_MAX;
const int MOD = 1000000000 + 7;
const int SIZE = 300005;
vector<int> Div(int n) {
  vector<int> ret;
  for (int i = 1; i * i <= n; ++i) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort((ret).begin(), (ret).end());
  return ret;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for (int i = 1; i < s.size(); ++i) {
    if (s[i] == '.' && s[i - 1] == '#') {
      ++cnt;
      s[i] = '#';
    }
  }
  cout << cnt << '\n';
  return 0;
}
