#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long mod = 1e9 + 7;
ll gcd(ll a, ll b);
ll lcm(ll a, ll b);
ll dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
int main() {
  ll n;
  string s;
  cin >> n >> s;
  bool flag = false;
  ll cnt = 0;
  for (ll i = 0; i < n; i++) {
    if (s[i] == '.') cnt++;
  }
  if (cnt == 0 || cnt == n)
    cout << 0;
  else {
    ll l, r, ans = mod;
    l = 0;
    r = cnt;
    for (ll i = 0; i < n - 1; i++) {
      if (s[i] == '.') {
        r--;
      } else {
        l++;
      }
      ans = min(ans, l + r);
    }
    cout << ans;
  }
  return 0;
}
ll gcd(ll a, ll b) {
  if (a % b == 0)
    return (b);
  else
    return (gcd(b, a % b));
}
ll lcm(ll a, ll b) { return a * b / gcd(a, b); }
