#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  int n;
  char s[1000000];
  cin >> n >> s;
  char searchchar;
  long int s_cnter = 0, need_ch = 0;
  while (s[s_cnter++]) {
    if (s[s_cnter - 1] == '#' && s[s_cnter] == '.') {
      need_ch++;
    }
  }
  cout << need_ch << endl;
  return 0;
}
