#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
const long long MOD = 1000000007;
const int MAX = 510000;
int main() {
  int N, ans = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') ans++;
  }
  cout << ans << endl;
}
