#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int i, j, cnt = 0;
  int n;
  cin >> n;
  string s;
  cin >> s;
  s += '#';
  int w = 0;
  for (i = 0; i <= n; i++) {
    if (s[i] == '.') w++;
  }
  int rw = w, lb = 0, mi = INT_MAX;
  for (i = 0; i <= n; i++) {
    if (s[i] == '#') {
      lb++;
    } else {
      rw--;
    }
    mi = min(lb + rw, mi);
  }
  cout << mi << endl;
}
