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