#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
int main(int argc, char *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int b = 0;
  int w = 0;
  int tmp = 1;
  if (S[0] == '.') {
    int i = 1;
    while (S[i] == '.') {
      tmp++;
      if (i == N - 1) {
        cout << 0 << endl;
        return 0;
      }
      i++;
    }
  }
  for (ll i = 0; i < N; i++) {
    if (S[i] == '#') {
      b++;
    } else {
      w++;
    }
  }
  if (S[0] == '.') {
    cout << min(b, w - tmp) << endl;
  } else {
    cout << min(b, w) << endl;
  }
  return 0;
}
