#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
const long long mo = 1e10 + 7;
const int M = 100 + 50;
const long long mod = 998244353;
int main() {
  int n;
  string s;
  cin >> n >> s;
  long long ans = 0;
  for (int i = 1; i < s.length(); i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      i--;
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
