#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, a, w = 0, b = 0, wans = 0, bans = 0, ans;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      w++;
      bans += b;
      b = 0;
    } else {
      b++;
      wans += w;
      w = 0;
    }
  }
  if (bans > 0) wans += w;
  ans = min(bans, wans);
  cout << ans << endl;
  return (0);
}
