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