#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int count = 0;
  int black = 0, white = 0;
  for (int i = 0; i < N; i++) {
    if (s.at(i) == '#')
      black++;
    else
      white++;
  }
  bool flag_1 = false, flag_2 = false;
  for (int i = 1; i < N; i++) {
    if (s.at(i - 1) == '#') flag_1 = true;
    if (flag_1) {
      if (s.at(i) == '.') {
        count++;
        flag_1 = false;
      }
    }
  }
  cout << count << endl;
}
