#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < (s.size() - 1); ++i) {
    if (s[i] == '#' && s[i + 1] == '.') {
      count++;
    }
  }
  cout << (count) << "\n";
}
