#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, tmp = 0, cnt = 0;
  string S;
  cin >> N >> S;
  int size = S.size();
  for (int i = 0; i < size; i++) {
    if (S[i] == '#')
      tmp++;
    else
      cnt = tmp;
  }
  cout << min(cnt, size - cnt) << endl;
}
