#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18L + 1;
const int INF = 1e9 + 1;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<int> L(n);
  vector<int> R(n);
  L[0] = 0;
  R[n - 1] = 0;
  int b = 0, w = 0;
  for (int i = 1; i < n; i++) {
    L[i] = L[i - 1];
    if (s[i - 1] == '#') {
      L[i]++;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    R[i] = R[i + 1];
    if (s[i + 1] == '.') R[i]++;
  }
  int ans = INF;
  for (int i = 0; i < (n - 1); ++i) {
    if (s[i] != s[i + 1]) {
      ans = min(ans, R[i + 1] + L[i + 1]);
    }
  }
  cout << ans << endl;
  return 0;
}
