#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0;
  int sl = s.length();
  for (int i = 0; i < sl; i++) {
    if (s[i] == '#') b++;
  }
  int ans = b;
  int w = 0;
  b = 0;
  for (int i = 0; i < sl; i++) {
    if (s[i] == '#')
      w++;
    else if (w) {
      b++;
    }
  }
  cout << min(ans, b) << endl;
  return 0;
}
