#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<ll, ll>;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  string s;
  cin >> s;
  s += '#';
  ll a = 0, b = 0;
  if (s[0] == '#') a++;
  for (ll i = n - 1; i >= 1; i--)
    if (s[i] == '.') b++;
  ll mn = 200010;
  for (ll i = 1; i <= n; i++) {
    mn = min(mn, a + b);
    if (s[i] == '#')
      a++;
    else
      b--;
  }
  cout << mn << "\n";
  return 0;
}
