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