#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  string b;
  cin >> a >> b;
  int e = 0;
  for (int i = a - 1; i >= 0; i--) {
    if (b[i] == '#')
      e++;
    else
      break;
  }
  int c = 0, d = 0;
  for (int i = 0; i < a - e; i++) {
    if (b[i] == '.') c++;
    if (b[i] == '#') d++;
  }
  if (c > d)
    cout << d << endl;
  else
    cout << c << endl;
  return 0;
}
