#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, ans = 0;
  bool b = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++) {
    if ((S.at(i) == '#') && (S.at(i + 1) == '.') && (b == 0)) {
      b = 1;
    }
    if ((S.at(i) == '.') && (S.at(i + 1) == '#') && (b == 1)) {
      b = 0;
    }
    if (b) ans++;
  }
  cout << ans << endl;
}
