#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const ll INF = 100100100;
const ll MOD = (ll)1e9 + 7;
const double EPS = 1e-9;
ll dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
ll dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
signed main() {
  ios::sync_with_stdio(false);
  ll i, n;
  string s;
  cin >> n;
  cin >> s;
  ll cnt = 0;
  ll cnt2 = 0;
  for (ll i = 1; i <= n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
