#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using R = double;
using Data = pair<ll, vector<int>>;
const ll MOD = 1e9 + 7;
const ll inf = 1LL << 50;
struct edge {
  ll from;
  ll to;
  ll cost;
};
int main() {
  int n;
  string s;
  cin >> n >> s;
  int sumw[202020];
  int sumb[202020];
  sumw[0] = (s[0] == '.');
  for (int i = 1; i < n; ++i) {
    sumw[i] = sumw[i - 1] + (s[i] == '.');
  }
  sumb[0] = (s[0] == '#');
  for (int i = 1; i < n; ++i) {
    sumb[i] = sumb[i - 1] + (s[i] == '#');
  }
  int ans = 303030;
  for (int i = 0; i < n; ++i) {
    if (i == 0) {
      ans = min(ans, sumw[n - 1]);
    } else if (i == n - 1) {
      ans = min(ans, sumb[n - 1]);
    } else {
      ans = min(ans, sumb[i] + (sumw[n - 1] - sumw[i]));
    }
  }
  cout << ans << endl;
  return 0;
}
