#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, c2 = 0, c1 = 0;
  long count1, count2;
  long sum = 0, min = LONG_MAX;
  string str;
  vector<long> vec;
  bool flag0, flag1;
  flag0 = flag1 = false;
  count1 = count2 = 0;
  cin >> N >> str;
  if (str[0] != '#') {
    vec.push_back(0);
  }
  for (long i = 0; i < N; i++) {
    if (str[i] == '.') {
      if (flag1 == true) {
        vec.push_back(c2);
        flag1 = false;
      }
      c1++;
      flag0 = true;
    } else {
      if (flag0 == true) {
        vec.push_back(c1);
        flag0 = false;
      }
      c2++;
      flag1 = true;
    }
  }
  if (flag1 == true) {
    vec.push_back(c2);
  }
  if (flag0 == true) {
    vec.push_back(c1);
  }
  sum = vec[1] + vec[(int)vec.size() - 1] - vec[0];
  for (long i = 3; i < (int)vec.size(); i += 2) {
    sum += ((vec[i - 1] - vec[i - 3]) - (vec[i] - vec[i - 2]));
    if (sum < min) {
      min = sum;
    }
  }
  for (int i = 0; i < N; i++) {
    if (str[i] == '.') {
      count1++;
    } else {
      count2++;
    }
  }
  if (count1 < count2) {
    if (count1 < min) {
      cout << count1;
    } else {
      cout << min;
    }
  } else {
    if (count2 < min) {
      cout << count2;
    } else {
      cout << min;
    }
  }
  return 0;
}
