#include <bits/stdc++.h>
using namespace std;
using myui = uint64_t;
using myint = int64_t;
template <typename T>
T diff(const T& a, const T& b) {
  return a > b ? a - b : b - a;
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  {
    myui n;
    cin >> n;
    string s;
    cin >> s;
    myui begin = 0;
    myui end = s.size();
    while (begin != end && s[begin] == '.') {
      begin++;
    }
    while (begin != end && s[end - 1] == '#') {
      end--;
    }
    myui cnt_w = 0;
    myui cnt_b = 0;
    for (myui i = begin; i < end; i++) {
      switch (s[i]) {
        case '.':
          cnt_w++;
          break;
        case '#':
          cnt_b++;
          break;
      }
    }
    cout << min(cnt_w, cnt_b) << endl;
  }
  return 0;
}
