#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string str[N];
  for (int i = 0; i < N; i++) {
    str[i] = S.substr(i, 1);
  }
  int ans = 0;
  for (int j = 0; j < N - 1; j++) {
    if (str[j] == "#" && str[j + 1] == ".") {
      ans++;
    }
  }
  cout << ans << endl;
}
