#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int A, B = 0, D = 0;
  cin >> A;
  string S;
  cin >> S;
  for (int i = 0; i < A - 1; i++)
    if (S[i] == '#' && S[i + 1] == '.') B++;
  cout << B << endl;
}
