#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  char x;
  vector<char> v;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> x;
    v.push_back(x);
  }
  long long dem = 0;
  for (long long i = 0; i < n - 1; ++i) {
    if (v[i] == '#' && v[i + 1] == '.') {
      ++dem;
      v[i + 1] = '#';
    }
  }
  cout << dem;
  return 0;
}
