#include <bits/stdc++.h>
using namespace std;
int n, cntw, cntb, ans;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s;
  for (int i = 1; i < n; ++i) {
    if (s[i] == '.' && s[i - 1] == '#') {
      cntw = cntb = 0;
      for (int j = i; j < n; ++j) {
        if (s[j] == '.')
          ++cntw;
        else
          break;
      }
      for (int j = i - 1; j >= 0; --j) {
        if (s[j] == '#')
          ++cntb;
        else
          break;
      }
      if (cntb <= cntw)
        ans += cntb;
      else {
        ans += cntw;
        s[i + (cntw - 1)] = '#';
      }
      i += (cntw - 1);
    }
  }
  printf("%d\n", ans);
}
