#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, pos, num = 0, ans, fnum, nnum = 0;
  string s;
  cin >> n >> s;
  pos = s.rfind('.');
  s = s.substr(0, pos + 1);
  for (i = 0; i < s.size(); i++)
    if (s[i] == '.') num++;
  fnum = s.size() - num;
  nnum = n - num;
  ans = min(num, min(fnum, nnum));
  cout << ans << endl;
  return 0;
}
