#include <bits/stdc++.h>
using namespace std;
int fx[4] = {1, -1, 0, 0};
int fy[4] = {0, 0, 1, -1};
int n, m;
const int mod = 998244353;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i < n - 1;) {
    if (s[i] == '#') {
      while (s[i + 1] == '.') {
        i++;
        c++;
      }
    }
    i++;
  }
  cout << c << endl;
}
