#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int count;
  string now, next;
  now = s.substr(0, 1);
  for (int i = 0; i < n - 1; i++) {
    next = s.substr(i + 1, 1);
    if (now == "#" && next == ".") {
      count++;
      now = "#";
    } else {
      now = next;
    }
  }
  cout << count << endl;
}
