#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;
ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};
const ll INF = 1LL << 50;
int main() {
  ll n;
  string str;
  cin >> n >> str;
  ll ans = 0;
  auto fb = str.find("#");
  auto lw = str.rfind(".");
  if (fb != string::npos && lw != string::npos && lw > fb) {
    string sbstr = str.substr(fb, lw - fb + 1);
    ll bc = count(sbstr.begin(), sbstr.end(), '#');
    ll wc = count(sbstr.begin(), sbstr.end(), '.');
    ans = min(bc, wc);
  }
  cout << ans << endl;
  return 0;
}
