#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0, w = 0, b = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '#')
      b++;
    else
      w++;
  }
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '#')
      cnt++;
    else
      break;
  }
  cout << min(b - cnt, w) << endl;
}
