#include <bits/stdc++.h>
using namespace std;
int search(int start, char t, string s) {
  int sum = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == t)
      sum += 1;
    else {
      break;
    }
  }
  return sum;
}
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int start = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') continue;
    start = i;
  }
  char prev = '*';
  for (int i = 0; i < n; i++) {
    if (prev == s[i]) {
      prev = s[i];
      continue;
    }
    if (prev == '#' && s[i] == '.') {
      sum += 1;
    }
    prev = s[i];
  }
  cout << sum << endl;
  return 0;
}
