#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int i;
  int Black = 0;
  int White = 0;
  bool flag = false;
  for (i = 0; i < S.length(); i++) {
    if (S[i] == '#') {
      if (i + 1 < S.length() && S[i + 1] == '.') flag = true;
      Black++;
    } else
      White++;
  }
  if (!flag)
    cout << 0 << endl;
  else
    cout << min(Black, White) << endl;
  return 0;
}
