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