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