#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, c = 0;
  cin >> n >> s;
  int* data;
  data = new int[n];
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '#')
      data[i] = 0;
    else
      data[i] = 1;
  }
  s.clear();
  for (int i = 0; i < n - 1; i++) {
    if (data[i] == 0 && data[i + 1] == 1) {
      data[i + 1] = 1;
      c++;
    }
  }
  cout << c << endl;
  delete data;
}
