#include <bits/stdc++.h>
using namespace std;
int main() {
  uint16_t N;
  string S;
  cin >> N >> S;
  uint32_t L = 0, R = N - 1;
  while (S[L] == '.' && L < R) ++L;
  while (S[R] == '#' && R > 0) --R;
  uint32_t WNum = 0, BNum = 0;
  for (; L != R; ++L) {
    if (S[L] == '.')
      ++WNum;
    else
      ++BNum;
  }
  if (S[R] == '.')
    ++WNum;
  else
    ++BNum;
  if (WNum < BNum)
    cout << WNum << endl;
  else
    cout << BNum << endl;
  return 0;
}
