#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string s;
  cin >> N >> s;
  if (s.length() == 1) {
    cout << "0" << endl;
    return 0;
  }
  int ans = 0;
  string ss = s;
  for (int i = 0; i < s.length() - 1; i++) {
    char niko = s[i];
    char ikko = s[i + 1];
    if (niko == '#' && ikko == '.') {
      s[i + 1] = '#';
      ans++;
    }
  }
  int ans2 = 0;
  for (int i = 0; i < ss.length() - 1; i++) {
    char niko = ss[i];
    char ikko = ss[i + 1];
    if (niko == '#' && ikko == '.') {
      ss[i] = '.';
      ans2++;
    }
  }
  cout << min(ans, ans2) << endl;
  return 0;
}
