#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  int n;
  int ans = 0;
  cin >> n >> s;
  int black_cnt = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s.at(i - 1) == '#') black_cnt++;
    if (s.at(i - 1) == '#' && s.at(i) == '.') {
      ans += black_cnt;
      black_cnt = 0;
    }
  }
  if (ans > s.length() / 2) ans = s.length() - ans;
  cout << ans << endl;
}
