#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(int argc, char **argv) {
  int n;
  cin >> n;
  string str;
  cin >> str;
  vector<int> v(n), v2(n);
  for (int i = 0; i < n; ++i) {
    if (str[i] == '#')
      v[i] = 2;
    else if (str[i] == '.')
      v[i] = 0;
  }
  v2 = v;
  for (int i = 0; i < n; ++i) {
    if (v[i] == 2) {
      for (int d = -1; d <= 1; ++d) {
        int ii = i + d;
        if (ii < 0 || ii >= n) continue;
        if (v[ii] == 0) v[ii] = 1;
      }
    }
  }
  int res{0};
  for (int i = 0; i < n; ++i) res += v[i] - v2[i];
  std::cout << res << std::endl;
}
