#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      cnt++;
      s[i] = '.';
    }
  }
  cout << cnt << endl;
}
