#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int sum = 0;
  int summ = 0;
  int cnt = 0;
  bool jud = false;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '.') jud = true;
    if (jud) {
      if (s[i] == '.')
        cnt++;
      else {
        summ++;
        sum += cnt;
        cnt = 0;
      }
    }
  }
  cout << min(sum, summ) << endl;
}
