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