#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n;
  cin >> s;
  int b = 0, w = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  string t = s;
  reverse(t.begin(), t.end());
  int k = 0;
  while (t[k] == '#') k++;
  t = t.substr(k);
  reverse(t.begin(), t.end());
  int b2 = 0, w2 = 0;
  for (int i = 0; i < ((int)(t).size()); ++i) {
    if (t[i] == '#')
      b2++;
    else
      w2++;
  }
  int ans = 0;
  if (b2 > w2) {
    ans = w2;
  } else
    ans = b2;
  cout << ans << endl;
  return 0;
}
