#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = n;
  int w = 0;
  int b = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.')
      w++;
    else
      b++;
  }
  int c, r;
  c = r = 0;
  res = 1e9;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.')
      c++;
    else
      r++;
    int ww = w - c;
    int bb = b - r;
    if (s[i] == '.') {
      ww++;
    }
    if (s[i] == '#') {
      bb++;
    }
    res = min(res, r + ww);
    res = min(res, c + bb);
  }
  res = min(res, w);
  res = min(res, b);
  cout << res << endl;
  return 0;
}
