#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, step = 0;
  cin >> n;
  string s, a[200001];
  cin >> s;
  for (int i = 1; i <= n; i++) a[i] = s[i - 1];
  for (int i = 1; i <= n; i++) {
    while (a[i] == "#" && a[i + 1] == ".") {
      a[i] = ".";
      step++;
    }
  }
  cout << step << endl;
  return 0;
}
