#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}
void solve(long long N, std::string S) {
  char prev = S[0];
  ll ans = 0;
  for (int i = 1; i < N; i++) {
    if (prev == '#' and S[i] == '.') {
      if (i + 1 < N and S[i + 1] == '.') {
        S[i] = '.';
      } else {
        S[i] = '#';
      }
      ans++;
    }
    prev = S[i];
  }
  std::cout << ans << std::endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::string S;
  std::cin >> S;
  solve(N, S);
  return 0;
}
