#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
int main() {
  int N;
  string set<int>;
  cin >> N >> set<int>;
  int ans = 0;
  for (int i = 0; i < (N - 1); ++i) {
    if (set<int>[i] == '#' && set<int>[i + 1] == '.') {
      ans++;
      set<int>[i + 1] = '#';
    }
  }
  cout << ans << endl;
  return 0;
}
