#include <bits/stdc++.h>
using namespace std;
int n, ans;
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s;
  for (int i = 1; i < n; ++i) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#', ++ans;
    }
  }
  printf("%d\n", ans);
}
