#include <bits/stdc++.h>
using namespace std;
using p = pair<long long, long long>;
long long dx[8] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dy[8] = {1, 0, -1, 0, 1, -1, 1, -1};
int main(void) {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long ans = 0;
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') ans++;
  }
  cout << ans << endl;
  return 0;
}
