#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  char S[200000];
  cin >> S;
  int ans = 0;
  int i = 0, k = -2;
  while (i < N) {
    if (k == -1 && S[i] == '#') {
      k = i;
    } else if (k == i - 1 && S[i] == '.') {
      ans++;
      k = -1;
    } else if (k == i - 1 && S[i] == '#') {
      k = i;
    }
    i++;
  }
  cout << ans << endl;
}
