#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  while (s.back() == '#') s.pop_back();
  ll black = 0;
  for (ll i = 0; i < s.size(); ++i)
    if (s[i] == '#') black++;
  cout << min(black, (ll)s.size() - black);
}
