#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
string s;
int n, ans;
int main() {
  cin >> n >> s;
  for (int i = 0; i + 1 < n; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      swap(s[i], s[i + 1]);
      ans++;
    }
  }
  cout << ans << endl;
}
