#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int fr = 0;
  while (fr < n && s[fr] == '.') {
    fr++;
  }
  int ans1 = 0;
  int ans2 = 0;
  for (int i = fr; i < n; ++i) {
    if (s[i] == '#') {
      ans1++;
    } else
      ans2++;
  }
  cout << min(ans1, ans2);
  return 0;
}
