#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  int f = 0, t = 0;
  int n1 = 0, n2 = 0;
  for (int i = 0; i < num; i++) {
    char c;
    cin >> c;
    if (c == '.') {
      n2 += t;
      t = 0;
      if (f) n1++;
    } else {
      t++;
      if (!f) f = 1;
    }
  }
  cout << min(n1, n2) << endl;
}
