#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> a;
  int count = (s[0] == '.') ? 1 : -1;
  for (int i = 1, len = s.size(); i < len; ++i) {
    if (s[i - 1] != s[i]) {
      a.push_back(count);
      count = 0;
    }
    count += (s[i] == '.') ? 1 : -1;
    if ((i + 1) == len) {
      a.push_back(count);
    }
  }
  if (a.size() == 1) {
    cout << 0 << endl;
    return 0;
  }
  int min = 100000;
  for (int i = 0, size = a.size(); i < size; ++i) {
    int w2b = 0, b2w = 0;
    for (int j = 0; j < i; ++j) {
      if (a[j] < 0) {
        b2w -= a[j];
      }
    }
    for (int j = i; j < size; ++j) {
      if (a[j] > 0) {
        w2b += a[j];
      }
    }
    int cost = b2w + w2b;
    if (min > cost) {
      min = cost;
    }
  }
  cout << min << endl;
}
