#include <bits/stdc++.h>
using namespace std;
int cnt;
void solve() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < n - 1; i++)
    if (s[i] == '#' && s[i + 1] == '.') cnt++;
  cout << cnt << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
