#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vp = vector<P>;
using vvi = vector<vi>;
using vvb = vector<vb>;
const int INF = 1e9;
const int MOD = 1e9 + 7;
signed main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  string S;
  cin >> S;
  int l = 0, r = N - 1;
  while (S[l] == '.') l++;
  while (S[r] == '#') r--;
  int black = 0;
  for (int i = l; i <= r; i++)
    if (S[i] == '#') black++;
  cout << min(black, r - l + 1 - black) << endl;
}
