#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#') {
      if (s[i + 1] == '.') {
        s[i + 1] = '#';
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
