#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  string s;
  cin >> s;
  vector<ll> a(N, 0);
  for (ll i = 0; i < N - 1; i++) {
    if (s.at(i) == '#' && s.at(i + 1) == '.') a[i] = 1;
  }
  vector<ll> S(N + 1, 0);
  for (ll i = 0; i < N; i++) S[i + 1] = S[i] + a[i];
  cout << S[N] << endl;
}
