#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const long long INF = 1LL << 50;
using P = pair<long long, long long>;
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  } else {
    return false;
  }
}
struct Setup {
  Setup() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} SETUP;
signed main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long left = 0;
  for (long long i = (0); i < (n); ++i) {
    if (s[i] == '#') {
      left = i;
      break;
    }
  }
  long long black = 0, white = 0;
  for (long long i = (left); i < (n); ++i) {
    if (s[i] == '#') {
      black++;
    } else {
      white++;
    }
  }
  if (s[n - 1] == '#') {
    black--;
  }
  long long ans = min(black, white);
  cout << ans << endl;
}
