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