#include <bits/stdc++.h>
using namespace std;
int cnt[10000];
int main() {
  int n;
  bool start = 0;
  cin >> n;
  int ans = 0;
  while (n--) {
    char a;
    cin >> a;
    if (start == 0) {
      if (a == '#') {
        start = 1;
        cnt[a]++;
        ans++;
      }
    } else {
      ans++;
      cnt[a]++;
    }
  }
  cout << min(ans - cnt['#'], ans - cnt['.']) << endl;
}
