#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  s += "#";
  int black_cnt = 0;
  int white_cnt = 0;
  bool flg = 0;
  int ans = 0;
  for (int i = 0; i < (s.length()); ++i) {
    if (s[i] == '.') {
      ++white_cnt;
    } else if (white_cnt != 0) {
      ans += min(black_cnt, white_cnt);
      black_cnt = 1;
      white_cnt = 0;
    } else {
      ++black_cnt;
    }
  }
  cout << ans << endl;
  return 0;
}
