#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, i, now, prev, count;
  int black, white;
  string S;
  cin >> N;
  cin >> S;
  prev = -1;
  count = 0;
  for (i = 0; i < N; i++) {
    if (S[i] == '.')
      now = 1;
    else
      now = 0;
    if (prev == 0 && now == 1) {
      count++;
      for (black = i - 2, white = i + 1;; black--, white++) {
        if (black < 0 || white >= N) break;
        if (S[black] == '#' && S[white] == '.') {
          i = white;
          count++;
        } else {
          break;
        }
      }
    }
    prev = now;
  }
  cout << count << endl;
}
