#include <bits/stdc++.h>
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops");
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
using ll = long long;
using ld = long double;
using Pa = pair<ll, ll>;
signed main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int white = 0;
  int redplase = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      redplase++;
    else
      break;
  }
  for (int i = 0; i < n; i++)
    if (s[i] == '.') white++;
  int red = n - white;
  white -= redplase;
  int white2 = 0;
  for (int i = redplase; i < redplase + white; i++)
    if (s[i] == '.') white2++;
  cout << min({red, white - white2}) << endl;
}
