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