#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, tmp;
  cin >> n;
  cin >> s;
  tmp = s;
  int count1 = 0;
  int count2 = 0;
  for (int i = 0; i < n - 1; i++) {
    if (tmp.substr(i, 1) == "#") {
      if (tmp.substr(i + 1, 1) == ".") {
        count1++;
        tmp.replace(i + 1, 1, "#");
      }
    }
  }
  tmp = s;
  for (int i = n - 1; i > 0; i--) {
    if (tmp.substr(i, 1) == ".") {
      if (tmp.substr(i - 1, 1) == "#") {
        count2++;
        tmp.replace(i - 1, 1, ".");
      }
    }
  }
  if (count1 < count2) {
    cout << count1 << endl;
  } else if (count1 >= count2) {
    cout << count1 << endl;
  }
  return 0;
}
