#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s;
  while (cin >> n >> s) {
    int cnt = 0;
    for (int i = 1; i < n; i++) {
      if (s[i - 1] == '#' && s[i] == '.') cnt++, s[i] = '#';
    }
    cout << cnt << endl;
  }
  return 0;
}
