#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, c, e, f, u;
  string b, d;
  cin >> a >> b;
  c = 0;
  e = 0;
  u = a;
  f = a;
  for (int i = 0; i < a; i++) {
    if (b[i] == '#') {
      c++;
    }
  }
  for (int i = 0; i < a; i++) {
    e = 0;
    for (int j = 0; j < i + 1; j++) {
      if (b[j] == '#') {
        e++;
      }
    }
    f = a - i - 1 - c + e;
    u = min(u, f + e);
  }
  cout << u << endl;
}
