#include <bits/stdc++.h>
using namespace std;
int main() {
  bitset<200000> x, y, z;
  int n;
  string s;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) x[i] = s[i] == '#';
  int r = 0;
  for (int p = 0; p <= n; p++) {
    for (int i = 0; i < n; i++) y[i] = p <= i;
    z = x ^ y;
    int t = z.count();
    if (!r || t < r) r = t;
  }
  cout << r << endl;
  return 0;
}
