#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
const int MOD = 1000000007;
const int INF = 1 << 30;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int ws = 0, ss = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s[i] == '.') ws++;
    if (i < n - 1 && s[i] == '#') ss++;
  }
  cout << min(ws, ss) << endl;
  return 0;
}
