#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long INFF = 1e18;
const int MAXN = 510;
const int MOD = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  bool bisa = 0;
  int black = 0;
  int white = 0;
  for (int i = 1; i <= n; i++) {
    char ta;
    cin >> ta;
    if (ta == '#') {
      bisa = 1;
      ++black;
    } else if (bisa)
      ++white;
  }
  cout << min(black, white) << endl;
}
