#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n, k;
  string s;
  cin >> n >> s;
  char ch = s[n - 1];
  long long c1 = 0, c2 = 0, ans = 0;
  vector<long long> v;
  long long c = 1;
  for (long long i = 1; i < n; ++i) {
    if (s[i] == s[i - 1])
      c++;
    else
      v.push_back(c), c = 1;
  }
  v.push_back(c);
  long long t = v.size();
  long long a1 = 0, a2 = 0, a3 = 0;
  if (t > 2) {
    for (long long i = 0; i < n; ++i) {
      if (s[i] == '.')
        a2++;
      else
        a1++;
    }
    long long z = min(a1, a2);
    long long cnt = 0, s1, s2;
    for (long long i = 0; i < t; ++i) {
      if (i % 2 == 0) s1 += v[i];
      if (i % 2 == 1) s2 += v[i];
    }
    long long x = 0;
    if (s[0] == '.') {
      for (long long i = 0; i < t; ++i) {
        if (i % 2 == 0)
          s1 -= v[i];
        else
          s2 -= v[i];
        x = min(s1, s2);
        z = min(z, x);
      }
    } else {
      for (long long i = 0; i < t; ++i) {
        if (i % 2 == 1)
          s1 -= v[i];
        else
          s2 -= v[i];
        x = min(s1, s2);
        z = min(z, x);
      }
    }
    cout << z;
  } else if (t == 2) {
    if (ch == '.')
      cout << min(v[0], v[1]);
    else
      cout << 0;
  } else if (t == 1)
    cout << 0;
  return 0;
}
