#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string s;
  cin >> n >> s;
  long long res1 = 0, res2 = 0;
  bool flg1 = false, flg2 = false;
  for (long long i = 1; i < n; i++) {
    if (flg1 && s[i] == '.') {
      res1++;
    } else {
      flg1 = false;
    }
    if (flg1 == false && s[i - 1] == '#' && s[i] == '.') {
      flg1 = true;
      res1++;
    }
    if (flg2 && s[n - i - 1] == '#') {
      res2++;
    } else {
      flg2 = false;
    }
    if (flg2 == false && s[n - i - 1] == '#' && s[n - i] == '.') {
      flg2 = true;
      res2++;
    }
  }
  cout << min(res1, res2) << endl;
  return 0;
}
