#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string str;
  cin >> n;
  cin >> str;
  vector<int> border(n / 2, 0);
  vector<int> ans(n / 2, 0);
  int arrpoint = 0;
  for (int i = 0; i != n - 1; i++) {
    if (str[i] == '.' && str[i + 1] == '#') {
      border[arrpoint] = i;
      arrpoint++;
    }
  }
  if (border[0] == 0 && border[1] == 0) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i != n / 2; i++) {
    for (int j = 0; j != border[i]; j++)
      if (str[j] == '#') ans[i]++;
    for (int j = border[i] + 1; j != n; j++)
      if (str[j] == '.') ans[i]++;
  }
  cout << *min_element(ans.begin(), ans.end()) << endl;
  return 0;
}
