#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  vector<int> v_b(n + 2);
  int cnt_b = 0;
  v_b[n + 1] = cnt_b;
  for (int i = n; i >= 1; --i) {
    auto sub = s.substr(i - 1, 1);
    if (sub == "#") {
      ++cnt_b;
    }
    v_b[i] = cnt_b;
  }
  v_b[0] = cnt_b;
  int cnt_w = 0;
  vector<int> v_w(n + 2);
  v_w[0] = cnt_w;
  for (int i = 1; i <= n; ++i) {
    auto sub = s.substr(i - 1, 1);
    if (sub == ".") {
      ++cnt_w;
    }
    v_w[i] = cnt_w;
  }
  v_w[n + 1] = cnt_w;
  int out = n;
  for (int i = 0; i < n + 2; ++i) {
    out = min(out, v_b[i] + v_w[i]);
  }
  cout << out << endl;
  return 0;
}
