#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, pos, pos2, num = 0, ans, fnum = 0;
  vector<int> sum;
  sum.push_back(0);
  string s;
  cin >> n >> s;
  for (i = 1; i < n; i++) {
    num++;
    if (s[i] != s[i - 1]) {
      sum.push_back(num);
      num = 0;
    }
  }
  sum.push_back(num + 1);
  num = 0;
  if (s[0] == '#') {
    for (i = 1; i < sum.size(); i += 2) num += sum[i];
    if (s[n - 1] == '#') num -= sum[sum.size() - 1];
    for (i = 2; i < sum.size(); i += 2) fnum += sum[i];
    ans = min(num, fnum);
  } else {
    for (i = 2; i < sum.size(); i += 2) num += sum[i];
    if (s[n - 1] == '#') num -= sum[sum.size() - 1];
    for (i = 3; i < sum.size(); i += 2) fnum += sum[i];
    ans = min(num, fnum);
  }
  cout << ans << endl;
  return 0;
}
