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