#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int count1 = 0;
  int count2 = 0;
  bool wall = true;
  bool ball = true;
  int bs = 0;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') wall = false;
    if (s[i] == '.') {
      ball = false;
      count2 += bs;
      bs = 0;
    }
    if (s[i] == '.' && !(wall)) count1++;
    if (s[i] == '#' && !(ball)) bs++;
  }
  if (count1 > count2) swap(count1, count2);
  cout << count1 << endl;
  return 0;
}
