#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const ll INF = 100100100;
const ll MOD = (ll)1e9 + 7;
const double EPS = 1e-9;
ll dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
ll dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
ll a[2000010];
ll b[2000010];
signed main() {
  ios::sync_with_stdio(false);
  ll n, i;
  string s;
  cin >> n >> s;
  for (ll i = (1); i < (n); i++) {
    if (s[i] == '#') {
      a[i] = a[i - 1] + 1;
    } else {
      a[i] = a[i - 1];
    }
    if (s[i] == '.') {
      b[i] = b[i - 1] + 1;
    } else {
      b[i] = b[i - 1];
    }
  }
  ll mi = INF;
  for (ll i = 0; i < n; i++) {
    mi = min(a[i + 1] + b[n] - b[i], mi);
  }
  cout << abs(mi) << endl;
  return 0;
}
