#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long N;
  string S;
  cin >> N >> S;
  long long count = 0;
  for (long long i = S.size(); i > 0; i--) {
    if (i != 0) {
      if (S[i - 1] == '#' && S[i] == '.') {
        count++;
        S[i - 1] = '.';
      }
    }
  }
  cout << min(N - count, count) << endl;
  return 0;
}
