#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
int main() {
  ll N;
  cin >> N;
  string second;
  cin >> second;
  if (N == 1) {
    cout << 0 << "\n";
  } else {
    ll startB = -1, endW = -1;
    for (ll i = 0; i < N; ++i) {
      if (second[i] == '#') {
        startB = i;
        break;
      }
    }
    for (ll i = N - 1; i >= 0; --i) {
      if (second[i] == '.') {
        endW = i;
        break;
      }
    }
    if (startB == -1 || endW == -1) {
      cout << 0 << "\n";
    } else {
      ll black = 0, white = 0;
      for (ll i = startB; i <= endW; ++i) {
        if (second[i] == '#') {
          black++;
        } else {
          white++;
        }
      }
      cout << min(black, white) << "\n";
    }
  }
  return 0;
}
