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