#include <bits/stdc++.h>
using namespace std;
long long ans, mx, sum, mn = 1e8, cnt;
int main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  for (long long i = 0; i < n; i++) {
    if (i < n - 1) {
      if (s[i] == '#' && s[i + 1] == '.') {
        ans++;
        s[i + 1] = '#';
      }
    }
  }
  cout << ans << endl;
}
