#include <bits/stdc++.h>
using namespace std;
int GCD(const int& a, const int& b) {
  const int& _a = max(a, b);
  const int& _b = min(a, b);
  if (_a % _b == 0) {
    return _b;
  } else {
    return GCD(_b, _a % _b);
  }
}
int LCM(const int& a, const int& b) {
  const int& _a = max(a, b);
  const int& _b = min(a, b);
  return (_a * _b) / (GCD(_a, _b));
}
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool is_ok = true;
  int ans = 0;
  if (s[0] == '.') {
    char old_si = '.';
    for (int i = 1; i < n; i++) {
      if (s[i] == '#') {
        old_si = '#';
      }
      if (old_si == '#' && s[i] == '.') {
        ans++;
        is_ok = false;
      }
    }
    if (is_ok) {
      cout << 0 << endl;
      return 0;
    }
    cout << ans << endl;
  } else {
    int ans_s = 0, ans_d = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '.') {
        ans_d++;
      } else {
        ans_s++;
      }
    }
    cout << min(ans_d, ans_s) << endl;
    return 0;
  }
}
