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