#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, ans = 0, ans2 = 0;
  char s[200100];
  cin >> n >> s;
  int brack, white;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      brack++;
    else
      white++;
  }
  for (; ans < n; ans++) {
    if (s[ans] == '.') break;
  }
  for (; ans2 < n; ans2++) {
    if (s[ans2] == '#') break;
  }
  cout << min(white - ans2, brack - ans2);
}
