#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int count = 0;
  while (1) {
    if (S.find("#.") == string::npos) {
      break;
    } else {
      S.replace(S.find("#."), 2, "##");
      count++;
    }
  }
  cout << count << endl;
}
