#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int siro = 0;
  int kuro = 0;
  bool flag = false;
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == '#' && !flag) {
      kuro++;
      flag = true;
      continue;
    }
    if (flag) {
      if (S[i] == '#')
        kuro++;
      else
        siro++;
    }
  }
  cout << min(kuro, siro) << endl;
}
