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