#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long cnta = 0, cntb = 0;
  long long memo = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') memo++;
  }
  if (!memo) {
    cout << 0 << endl;
    getchar();
    getchar();
    return 0;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnta++;
    else
      cntb++;
  }
  cout << min(cnta, cntb) << endl;
  getchar();
  getchar();
  return 0;
}
