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