#include <bits/stdc++.h>
using namespace std;
template <typename T>
void cins(vector<T>& arr) {
  for (T& e : arr) cin >> e;
}
int count(vector<int>& arr) {
  int res = 0;
  for (int i = 2; i < arr.size(); i += 2) {
    res += arr[i];
  };
  return res;
}
int main(void) {
  int num;
  cin >> num;
  string str;
  cin >> str;
  str.push_back(0);
  vector<int> arr;
  char prev = str[0];
  int cnt = 0;
  if (prev == '#') arr.push_back(0);
  for (int i = 0; i < str.length(); i++) {
    char cur = str[i];
    if (prev == cur) {
      cnt++;
    } else {
      arr.push_back(cnt);
      cnt = 1;
    }
    prev = cur;
  }
  if (arr.size() % 2 == 1) arr.push_back(0);
  ;
  int ans = (1e+7);
  ans = min(ans, count(arr));
  reverse(arr.begin(), arr.end());
  ans = min(ans, count(arr));
  cout << ans << endl;
  return 0;
}
