#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MOD = INF + 7;
using P = pair<long long, long long>;
signed main() {
  long long N;
  string S;
  cin >> N >> S;
  long long ans = 0;
  for (long long i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ans++;
      S[i + 1] = '#';
    }
  }
  cout << ans << endl;
}
