#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
int main() {
  ll n;
  cin >> n;
  bool flag = 0;
  ll b = 0, w = 0;
  for (int i = 0; i < (int)(n); i++) {
    char c;
    cin >> c;
    if (flag) {
      if (c == '#')
        b++;
      else
        w++;
    } else if (c == '#') {
      flag = 1;
      b++;
    }
  }
  cout << min(b, w) << endl;
}
