#include <bits/stdc++.h>
using namespace std;
string s;
int n;
vector<int> series;
int main() {
  cin >> n >> s;
  char head = s[0];
  char tail = s[s.size() - 1];
  char now = head;
  int cnt_series = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != now) {
      series.push_back(cnt_series);
      cnt_series = 1;
      now = s[i];
    } else
      cnt_series++;
    if (i == s.size() - 1) series.push_back(cnt_series);
  }
  int sum_w = 0;
  for (auto i = begin(series) + 1; i < end(series); i += 2) {
    sum_w += *i;
  }
  if (series.size() == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (head == '.') {
    sum_w -= series[0];
    series.erase(series.begin());
  }
  int sum_b = 0;
  int ans = sum_w;
  for (auto i = begin(series); i < end(series); i += 2) {
    sum_b += *i;
    if (i + 1 < end(series)) sum_w -= *(i + 1);
    ans = min(sum_b + sum_w, ans);
  }
  cout << ans << endl;
}
