#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
using namespace std;
int main() {
  int n, count = 0;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' and s[i + 1] == '.') count++;
  }
  cout << count << "\n";
}
