#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
const ll MAX = 1e9;
int main() {
  int n;
  string s;
  cin >> n >> s;
  if (s.find("#.") == s.npos) {
    cout << 0 << endl;
    return 0;
  }
  int p = s.find("#.");
  int ans = 0;
  for (int i = p; i < n; i++) {
    if (s[i] == '.') ans++;
  }
  int cnt = 0;
  size_t q = s.find("#.", 0);
  while (true) {
    cnt++;
    q = s.find("#.", q + 1);
    if (q == s.npos) break;
  }
  ans = min(ans, cnt);
  cout << ans << endl;
}
