#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MOD = 1000000007;
int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int s = 0, d = 0;
  for (int i = 0; i < (int)N; ++i) {
    if (S[i] == '#') s++;
    if (S[i] == '.') d++;
  }
  cout << min(s, d) << endl;
  return 0;
}
