#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;
  string R = S;
  reverse(R.begin(), R.end());
  int b = 0, w = 0;
  bool flg_b = false, flg_w = false;
  for (int i = 0; i < (int)N; ++i) {
    if (S[i] == '#') flg_b = true;
    if (R[i] == '.') flg_w = true;
    if (flg_b && S[i] == '.') b++;
    if (flg_w && S[i] == '#') w++;
  }
  cout << min(b, w) << endl;
  return 0;
}
