#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0;
  int cnt_w = 0, cnt_b = 0;
  for (int i = (0); i < ((n / 2)); i++) {
    if (s[i] == '#') {
      cnt_b++;
    } else {
      ans += cnt_b;
      cnt_b = 0;
    }
    if (s[n - i - 1] == '.') {
      cnt_w++;
    } else {
      ans += cnt_w;
      cnt_w = 0;
    }
  }
  if (n % 2) {
    if (s[n / 2] == '#') {
      ans += min(cnt_b + 1, cnt_w);
    } else {
      ans += min(cnt_b, cnt_w + 1);
    }
  }
  cout << ans << endl;
}
