#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int ans = 0, c = 0, d = 0;
  string a = s, b = s, x = s;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == '#' and a[i + 1] == '.') {
      a[i + 1] = '#';
      c++;
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    if (b[i] == '.' and b[i - 1] == '#') {
      b[i - 1] = '.';
      d++;
    }
  }
  int mist = 0;
  for (int i = 0; i < n - 1; i++) {
    if (x[i] == '#' and x[i + 1] == '.') {
      if (i + 2 < n and (i >= 1 ? (s[i - 1] != '#' ? true : false) : true)) {
        if (x[i + 2] == '.') {
          x[i] = '.';
          mist++;
        } else {
          x[i + 1] = '#';
          mist++;
        }
      } else {
        x[i + 1] = '#';
        mist++;
      }
    }
  }
  cout << min(c, min(d, mist)) << endl;
  return 0;
}
