#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
template <class T>
void cout_vec(const vector<T> &vec1) {
  for (long long i = 0; i < long long(vec1.size()); i++) {
    cout << vec1[i] << ' ';
  }
  cout << '\n';
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  if (n == 2 && s[0] == '#' && s[1] == '.') {
    cout << 1 << endl;
    return 0;
  }
  for (long long i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      ans++;
    }
  }
  cout << ans << endl;
}
