#include <bits/stdc++.h>
using namespace std;
int n, f[200010][2];
string s;
int main() {
  cin >> n;
  cin >> s;
  f[0][0] = f[0][1] = 0;
  for (int i = 0; i < n; ++i)
    if (s[i] == '.') {
      f[i + 1][0] = f[i][0];
      f[i + 1][1] = f[i][1] + 1;
    } else {
      f[i + 1][1] = f[i][1];
      f[i + 1][0] = f[i][0] + 1;
    }
  cout << min(f[n][0], f[n][1]);
  return 0;
}
