#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  string s;
  int scount = 0;
  int dcount = 0;
  int count = 1000000000;
  cin >> a >> s;
  vector<int> T(a + 1);
  T[0] = 0;
  for (int i = 0; i < a + 1; i++) {
    if (s[i] == '#') {
      T[i + 1] = T[i] + 1;
    } else {
      T[i + 1] = T[i];
    }
  }
  for (int i = 0; i < a; i++) {
    scount = T[i];
    dcount = a - i - (T[a] - T[i]);
    count = min(scount + dcount, count);
  }
  cout << count << endl;
  return 0;
}
