#include <bits/stdc++.h>
using namespace std;
template <typename T>
void printlnVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << endl;
  }
}
template <typename T>
void printVector(T v) {
  for (int i = 0; i < (int)(v.size()); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < (int)(N - 1); i++) {
    if (S.substr(i, 2) == "#.") {
      S[i + 1] = '.';
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
