#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int min_num = n;
  vector<int> c;
  int count = 1;
  int num = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s.at(i) == s.at(i + 1))
      count++;
    else {
      c.emplace_back(count);
      count = 1;
    }
  }
  c.emplace_back(count);
  if (s.at(0) == '.') {
    num = 0;
    for (int i = 1; i < c.size(); i += 2) {
      num += c.at(i);
    }
    if (num < min_num) min_num = num;
    num = 0;
    for (int i = 0; i < c.size(); i += 2) {
      num += c.at(i);
    }
    if (num < min_num) min_num = num;
    for (int i = 1; i < c.size(); i += 2) {
      num = 0;
      for (int j = i + 1; j < c.size(); j += 2) {
        num += c.at(j);
      }
      for (int j = 1; j < i - 1; j += 2) {
        num += c.at(j);
      }
      if (num < min_num) min_num = num;
    }
  } else {
    num = 0;
    for (int i = 0; i < c.size(); i += 2) {
      num += c.at(i);
    }
    if (num < min_num) min_num = num;
    num = 0;
    for (int i = 1; i < c.size(); i += 2) {
      num += c.at(i);
    }
    if (num < min_num) min_num = num;
    for (int i = 1; i < c.size(); i += 2) {
      num = 0;
      for (int j = i; j < c.size(); j += 2) {
        num += c.at(j);
      }
      for (int j = 0; j < i - 1; j += 2) {
        num += c.at(j);
      }
      if (num < min_num) min_num = num;
    }
  }
  cout << min_num << endl;
}
