#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 2e5 + 100;
char a[N], b[N];
int main() {
  int n;
  cin >> n;
  cin >> a;
  int tnt = 0, tnt2 = 0;
  b[0] = a[0];
  for (int i = 1; i < n; i++) {
    b[i] = a[i];
    if (a[i] == '.') {
      if (a[i - 1] == '#') {
        tnt++;
        b[i] = '#';
      }
    }
  }
  b[n - 1] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    b[i] = a[i];
    if (b[i] == '#') {
      if (b[i + 1] == '.') {
        b[i] = '.';
        tnt2++;
      }
    }
  }
  cout << min(tnt, tnt2) << endl;
  return 0;
}
