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