#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int ans = 0;
  if (N == 1) {
    cout << ans;
  } else {
    for (int i = 1; i < S.size(); i++) {
      if (S[i - 1] == '#' && S[i] == '.') {
        ans++;
      }
    }
    cout << ans;
  }
  return 0;
}
