#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}
signed main() {
  long long N;
  string S;
  cin >> N;
  cin >> S;
  long long x = 0;
  long long y = 0;
  for (long long i = 0; i < (N); i++) {
    if (S[i] == '#') {
      x++;
    } else {
      y++;
    }
  }
  if (x == 0 || y == 0) {
    cout << "0" << endl;
    return 0;
  }
  if (x <= y) {
    cout << x << endl;
  } else {
    cout << y << endl;
  }
  return 0;
}
