#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  bool flag = false;
  int w = 0, b = 0;
  for (int(i) = 0; (i) < (N); (i)++) {
    if (!flag && s[i] == '#') {
      flag = true;
    }
    if (flag) {
      if (s[i] == '#') {
        b++;
      } else {
        w++;
      }
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (s[i] == '#')
      b--;
    else
      break;
  }
  cout << min(w, b) << endl;
}
