#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long cnt = 0;
  for (size_t i = 0; i < n; i++) {
    if (s[i] == '.') break;
    cnt++;
  }
  long long sharp = 0;
  long long dot = 0;
  for (size_t i = cnt; i < n; i++) {
    if (s[i] == '.')
      dot++;
    else
      sharp++;
  }
  if (sharp > dot) {
    cout << dot << endl;
  } else {
    cout << sharp << endl;
  }
}
