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