#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  s = '.' + s + '#';
  vector<int> m, m1, m2;
  int k = 1;
  for (int i = 0; i < n + 1; i++) {
    if (s[i] == '.') {
      if (s[i + 1] == '#') {
        m.push_back(k);
        k = 1;
      } else
        k++;
    } else {
      if (s[i + 1] == '.') {
        m.push_back(k);
        k = 1;
      } else
        k++;
    }
  }
  m2.push_back(0);
  for (int i = 0; i < m.size(); i++) {
    if (i % 2 == 0) {
      if (i == 0)
        m1.push_back(m.at(0));
      else
        m1.push_back(*(m1.end() - 1) + m.at(i));
    } else {
      if (i == 1)
        m2.push_back(m.at(1));
      else
        m2.push_back(*(m2.end() - 1) + m.at(i));
    }
  }
  int ans = n;
  for (int i = 0; i < m1.size(); i += 2) {
    int ans1 = m1.at(m1.size() - 1) - m1.at(i) + m2.at(i);
    ans = min(ans, ans1);
  }
  cout << ans << endl;
}
