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