#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  long long mask = 0;
  long long sbit = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      sbit = sbit << 1;
    } else {
      sbit = sbit << 1;
      sbit++;
    }
  }
  long long tmp = 1000000000;
  for (int i = 0; i <= n; i++) {
    long long res = sbit ^ mask;
    res = (res & 0x5555) + ((res & 0xAAAA) >> 1);
    res = (res & 0x3333) + ((res & 0xCCCC) >> 2);
    res = (res & 0x0F0F) + ((res & 0xF0F0) >> 4);
    res = (res & 0x00FF) + ((res & 0xFF00) >> 8);
    tmp = std::min(res, tmp);
    mask = mask << 1;
    mask++;
  }
  cout << tmp << endl;
}
