#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int sha = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s.at(i) == '#') sha++;
    if (s.at(i) == '.') break;
  }
  int g = n - sha, d = 0;
  if (g == 0) {
    d = 0;
  } else {
    for (int i = 0; i < g; i++)
      if (s.at(i) == '.') d++;
  }
  cout << min(d, g - d) << endl;
}
