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