#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s, t;
  cin >> n >> s;
  t = s;
  int ans = 0;
  for (long long(i) = 0; (i) < (long long)(t.size() - 1); ++(i)) {
    if (t[i] == '#' && t[i + 1] == '.') {
      t[i + 1] = '#';
      ans++;
    }
  }
  int tmp = 0;
  t = s;
  for (long long(i) = (long long)(t.size() - 1) - 1; (i) >= 0; --(i)) {
    if (t[i + 1] == '.' && t[i] == '#') {
      tmp++;
      t[i] = '.';
    }
  }
  ans = min(tmp, ans);
  cout << ans << endl;
  return 0;
}
