#include <bits/stdc++.h>
static const long long int MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  long long int n;
  cin >> n;
  long long int b = 0, w = 0;
  long long int ans = 10000000;
  string s;
  cin >> s;
  for (int i = 0; i < (int)(s.length()); i++) {
    if (s[i] == '.') w++;
  }
  for (int i = 0; i < (int)(s.length()); i++) {
    if (s[i] == '.')
      w--;
    else
      b++;
    ans = min(ans, b + w);
  }
  cout << ans;
}
