#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a = 0, b, c = 0;
  string s;
  cin >> n >> s;
  while (n > 0 && s[0] == '.') {
    s.erase(0, 1);
    n--;
  }
  while (n > 0 && s[n - 1] == '*') {
    s.erase(n - 1, 1);
    n--;
  }
  for (i = 0; i < n; i++)
    if (s[i] == '.') a++;
  b = a;
  for (i = 0; i < n; i++) {
    if (s[i] == '*') {
      if (i != 0 && s[i - 1] == '.') {
        b += c;
        a = min(a, b);
        c = 0;
      }
      c++;
    } else
      c--;
  }
  b += c;
  a = min(a, b);
  cout << a << endl;
  return 0;
}
