#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, cnt = 0, cntt = 0;
  string s;
  cin >> n >> s;
  string ss = s;
  n = s.length();
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#') {
      int j = 1;
      for (; s[i + j] == '#' && i + j < n; j++)
        ;
      int k = 1;
      for (; s[i + j + k] == '.' && i + j + k < n && k <= j; k++)
        ;
      if (j < k) {
        cnt += j;
        i += j - 1;
      } else {
        cnt += k;
        i += j + k - 1;
      }
    }
  }
  cout << cnt;
}
