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