#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans = 0, N;
  string S;
  cin >> N >> S;
  int arr[S.size()];
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.') arr[i] = 0;
    if (S[i] == '#') arr[i] = 1;
  }
  for (int i = 1; i < S.size(); i++) {
    if (arr[i] == 0 && arr[i - 1] == 1) {
      arr[i] = 1;
      ans++;
    }
  }
  cout << ans << endl;
}
