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