#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll black = 0;
  ll white = 0;
  ll flag = 0;
  for (auto x : s) {
    if (x == '#')
      black++;
    else if (black)
      white++;
  }
  cout << fixed << min(black, white) << endl;
}
