#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18 + 1;
int main() {
  int N;
  cin >> N;
  string s;
  cin >> s;
  int w = count(s.cbegin(), s.cend(), '.');
  int b = count(s.cbegin(), s.cend(), '#');
  cout << min(w, b) << endl;
  return 0;
}
