#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = acos(-1);
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
int main() {
  ll n;
  string s;
  cin >> n >> s;
  ll black = 0, white = 0;
  bool z = false;
  for (ll i = 0; i < (n); ++i) {
    if (s[i] == '#') z = true;
    if (z) {
      if (s[i] == '#')
        black++;
      else
        white++;
    }
  }
  if (white == n || black == n) {
    cout << 0 << endl;
  } else if (black == 0 || white == 0) {
    cout << max(black, white) << endl;
  } else {
    cout << min(black, white) << endl;
  }
  return 0;
}
