#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  char prev = 'Z';
  int64_t ans = 0;
  for (int i = 0; i < N; i++) {
    char cur = S[i];
    if (cur == '.' && prev == '#') {
      ans++;
      if (i + 1 == N) {
      } else {
        char next = S[i + 1];
        if (next == '.') {
          S[i - 1] = '.';
        } else {
          S[i] = '#';
        }
      }
    }
    prev = cur;
  }
  cout << ans << endl;
  return 0;
}
