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