#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long N, res1 = 0, res2 = 0;
  string S;
  cin >> N >> S;
  string S2(string(S.c_str(), S.length()));
  for (int i = 0; i < S.length() - 1; ++i) {
    if (S[i] == '.') continue;
    if ((S[i] == '#') && (S[i + 1] == '.')) {
      S[i + 1] = '#';
      ++res1;
    }
  }
  for (int i = S2.length() - 1; i > 0; --i) {
    if (S2[i] == '#') continue;
    if ((S2[i] == '.') && (S2[i - 1] == '#')) {
      S2[i - 1] = '.';
      ++res2;
    }
  }
  if (res1 < res2)
    cout << res1 << endl;
  else
    cout << res2 << endl;
}
