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